use strict; use Win32::OLE; my $wsh = new Win32::OLE 'WScript.Shell'; my $targetExactWindowName = "The exact window title of your application"; # This brings it to the foreground $wsh->AppActivate( $target ); # Type some keys in the Window, here Ctr+P followed by Enter $wsh->SendKeys('^(p)'); $wsh->SendKeys('{ENTER}');