snooz Posted April 12, 2005 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
GaryFrost Posted April 12, 2005 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.
snooz Posted April 12, 2005 Author 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!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now