snooz 0 Posted April 12, 2005 I am looking to come up with a script that prompts for a machine name and then stops and starts the spooler service. I cannot get the RunWait syntax down. Everything works except the sc command-line. Here is what I have so far; Do $machine = InputBox("Spooler Restart", "\\SERVERNAME", "\\???-SRV-01", "", _ 0, 1, -1, -1) If @error == 1 Then Exit Until $machine <> " " RunWait(@ComSpec & " /c sc $machine stop spooler","",@sw_hide) if RunWait(@ComSpec & " /c sc $machine start spooler","",@sw_hide) == 0 Then MsgBox(0, $machine,"Spooler Service Restarted") Else MsgBox(0, $machine,"Cannot Restart Spooler Service") EndIf Share this post Link to post Share on other sites
GaryFrost 18 Posted April 12, 2005 (edited) RunWait(@ComSpec & " /c sc " & $machine & " stop spooler","",@sw_hide) here's the second one RunWait(@ComSpec & " /c sc " & $machine & " start spooler","",@sw_hide) Edited April 12, 2005 by gafrost SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Share this post Link to post Share on other sites
snooz 0 Posted April 12, 2005 RunWait(@ComSpec & " /c sc " & $machine & " stop spooler","",@sw_hide)here's the second oneRunWait(@ComSpec & " /c sc " & $machine & " start spooler","",@sw_hide)<{POST_SNAPBACK}>Thanks worked like a charm! Share this post Link to post Share on other sites