#! c:\perl\bin $|++; use strict; use Win32; use Win32::GuiTest qw(FindWindowLike GetWindowText SetForegroundWindow SendKeys); use vars qw /%data/; $Win32::GuiTest::debug = 0; # Set to "1" to enable verbose mode $data{apps_list} = shift @ARGV; $data{host} = Win32::NodeName(); system (cls); print "\nThis machine is ". $data{host}; print "\n\nPath to apps list => ". $data{apps_list}."\n"; open (LST, "$data{apps_list}") || die "$! : File was not found\n"; chomp (@{$data{Go_scripts}} = ); for my $item (@{$data{Go_scripts}}) { print "\n$item\n"; system ($item); my @win =FindWindowLike(0, "^Go", ""); for (@win) { print "$_>\t'", GetWindowText($_), "'\n"; SetForegroundWindow($_); ); } #print "$^E, $!\n".Win32::FormatMessage(Win32::GetLastError()); Win32::AbortSystemShutdown($data{host}); print "\nDone\n"; }