2009-11-17 1 views

Répondre

19

Voici un script qui fait cela. Voir Windows PowerShell Blog pour l'exemple original.

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

Sur PowerShell 2.0, vous pouvez remplacer cette première ligne par '$ p = Start-Process Notepad -passthru ' –

Questions connexes