dreamzboy Posted October 10, 2007 Share Posted October 10, 2007 Hi Everyone,As the title stated, I want to run a script to stop certain Windows Services and then Start them again. Is there a command to do this? Can someone provide me an example or shine some light on me? I know there's a way to do it using Batch File, but if I can write it in AutoIT, I rather do it that way since it's cooler looking than the black dos screen. Greatly appreciated.Dreamzboy Link to comment Share on other sites More sharing options...
weaponx Posted October 10, 2007 Share Posted October 10, 2007 Net Start:http://www.microsoft.com/resources/documen...t.mspx?mfr=trueNet Stop:http://www.microsoft.com/resources/documen...p.mspx?mfr=true;Return code ;0 = Success ;2 = Already Stopped / Started $result = RunWait(@ComSpec & " /c net stop server", @ScriptDir, @SW_HIDE) MsgBox(0,"",$result) $result = RunWait(@ComSpec & " /c net start server", @ScriptDir, @SW_HIDE) MsgBox(0,"",$result) Link to comment Share on other sites More sharing options...
dreamzboy Posted October 11, 2007 Author Share Posted October 11, 2007 Net Start: http://www.microsoft.com/resources/documen...t.mspx?mfr=true Net Stop: http://www.microsoft.com/resources/documen...p.mspx?mfr=true ;Return code ;0 = Success ;2 = Already Stopped / Started $result = RunWait(@ComSpec & " /c net stop server", @ScriptDir, @SW_HIDE) MsgBox(0,"",$result) $result = RunWait(@ComSpec & " /c net start server", @ScriptDir, @SW_HIDE) MsgBox(0,"",$result)oÝ÷ Ûú®¢×¦ñRȧ*.Êx¨v'âyض®¶scµ&WGW&â6öFP£³Ò7V66W70£³"ÒÇ&VG7F÷VBò7F'FV@ ¢b33c·&W7VÇBÒ'VåvB6öÕ7V2fײgV÷C²ö2æWB7F÷v&VÆW72¦W&ò6öæfwW&FöâgV÷C²Â67&DF"Â5uôDR ¤×6t&÷ÂgV÷C²gV÷C²Âb33c·&W7VÇB ¢b33c·&W7VÇBÒ'VåvB6öÕ7V2fײgV÷C²ö2æWB7F'Bv&VÆW72¦W&ò6öæfwW&FöâgV÷C²Â67&DF"Â5uôDR ¤×6t&÷ÂgV÷C²gV÷C²Âb33c·&W7VÇB The message box showed up with the value 1 for result, but it did not stop the service. I'm not sure if I modified it correctly, can you justify? Thanks, Dreamzboy Link to comment Share on other sites More sharing options...
herewasplato Posted October 12, 2007 Share Posted October 12, 2007 Take a look at the FAQ sticky at the top of this forum:http://www.autoitscript.com/forum/index.ph...st&p=253174 Q5. How can I start/stop or otherwise control a service?MSP [size="1"][font="Arial"].[u].[/u][/font][/size] Link to comment Share on other sites More sharing options...
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