#! c:\perl\bin $|++; use strict; use Win32; use Win32::GuiTest qw(:ALL :SW); use vars qw /%data/; $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"; eval {system ($item); print "\n********* YOU ARE HERE ********\n"; my @windows = FindWindowLike(0, 'GO'); for my $win (@windows) { print "Found window $win with title '", GetWindowText($win), "'\n"; my @children = GetChildWindows($win); for my $child (@children) { my $text = GetWindowText($child); # next if ($text =~ /^\xff/); # you've found the icon #next if ($text =~ /^OK|Cancel|Abort|Retry|Ignore|Yes|No$/); # you've found a button print "Found child $child with text '$text'\n"; } }}; Win32::AbortSystemShutdown($data{host}); print "\nDone\n"; }