Run a program from PowerShell with timeout Run a program from PowerShell with timeout powershell powershell

Run a program from PowerShell with timeout


Here is a script which does that. See Windows PowerShell Blog for the original example.

$p = [diagnostics.process]::start("notepad.exe")if ( ! $p.WaitForExit(1000) )   { echo "Notepad did not exit after 1000ms"; $p.kill() }