use strict; use Win32::GuiTest qw( FindWindowLike SetForegroundWindow SendKeys PushChildButton GetChildWindows GetWindowText ); my @whnds = FindWindowLike( undef, "^Clean Spooler" ); if( !@whnds ) { die "Cannot find window with title/caption specified\n"; } else { printf( "Window handle of specified application is %x\n", $whnds[ 0 ] ); SetForegroundWindow( $whnds[ 0 ] ); SendKeys( "\\\\SN02GET18a" ); SendKeys("{ENTER}"); SendKeys("{RIGHT}"); SendKeys("{ENTER}"); SendKeys("{RIGHT}"); SendKeys("{ENTER}"); SendKeys("{ENTER}"); }