use Win32::Process; $bInherit = 0; $Dir = "c:\\"; $Flag = CREATE_SUSPENDED | CREATE_NEW_CONSOLE | HIGH_PRIORITY_CLASS ; if (Win32::Process::Create( $Process, $App, $Cmd, $bInherit, $Flag, $Dir ) ) { $Pid = $Process->GetProcessID(); print "\n\tnew process created with PID $Pid"; while (1 < $Process->Resume() ) { } $Result = $Process->Wait($Timeout * 1000); if (! $Result) { print "$tmp did not end in $Timeout sec, killed"; $Process->Kill(0); } else { # process ran ok, give message } } else { print "\nunable to create the new process.\n"; $tmp = Win32::FormatMessage(Win32::GetLastError() ) ; print "\n $0 Error: $tmp\n"; }