#! perl -slw use strict; use Win32::GuiTest qw[FindWindowLike SetForegroundWindow SendKeys]; system 1, q[notepad.exe]; Win32::Sleep( 10000 ); for ( FindWindowLike( undef, 'Notepad' ) ) { SetForegroundWindow( $_); SendKeys( '%fx', 5 ); }