midiaxe Posted September 1, 2004 Share Posted September 1, 2004 Hello everybody, I have an installation where I need to stop an existing service before the installation and restart after. I looked at the AI doc and didn't find anything about starting/stopping a service. I guess it's not available yet in the current version ( I hope I'm wrong). I can use "net start <service>" and "net stop <service>" but would like to use an autoit function. Thanks, =MX= Link to comment Share on other sites More sharing options...
Andre Posted September 1, 2004 Share Posted September 1, 2004 Hi, is indeed not a default function. Perhaps post an message in the Idea section ? Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
ezzetabi Posted September 1, 2004 Share Posted September 1, 2004 It is a good idea. But I would even greater if it they'll also non standard commands like "Disable Sevice", or if possible even "Uninstall Service". Link to comment Share on other sites More sharing options...
Andre Posted September 2, 2004 Share Posted September 2, 2004 To Ezzetabi, to Disable service see : RegWrite("HKLM\System\CurrentControlSet\Services\{servicename}\Start"......... Andre What about Windows without using AutoIt ?It would be the same as driving a car without an steering Wheel! Link to comment Share on other sites More sharing options...
JerryD Posted September 2, 2004 Share Posted September 2, 2004 If you know you'll only be using WinXP ONLY, try the SC command (Service Controller). Use Windows Help (gasp!) and type A-Z in the search bar, and click on "Command-line reference A-Z" and then on the letter S at the top of the window. SC will be at the top of the list - click on it for the full reference. Jerry Link to comment Share on other sites More sharing options...
kristoff Posted September 2, 2004 Share Posted September 2, 2004 (edited) If you know you'll only be using WinXP ONLY, try the SC command (Service Controller). Use Windows Help (gasp!) and type A-Z in the search bar, and click on "Command-line reference A-Z" and then on the letter S at the top of the window. SC will be at the top of the list - click on it for the full reference. Jerry <{POST_SNAPBACK}>If you want to remove service see these keys : regdelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentControlSet\Services\xxxxxxxxx") regdelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentControlSet\Enum\Root\xxxxxxxxxxxxx") where the x are service name. To stop the service : RunWait(@ComSpec & " /c " & 'net stop <service>', "", @SW_HIDE) works fine. chees Edited September 2, 2004 by kristoff Link to comment Share on other sites More sharing options...
CyberSlug Posted September 2, 2004 Share Posted September 2, 2004 If you want to remove service see these keys :regdelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentControlSet\Services\xxxxxxxxx")regdelete("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentControlSet\Enum\Root\xxxxxxxxxxxxx")Er, maybe you mean:"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services" Use Mozilla | Take a look at My Disorganized AutoIt stuff | Very very old: AutoBuilder 11 Jan 2005 prototype I need to update my sig! Link to comment Share on other sites More sharing options...
bobheart Posted September 2, 2004 Share Posted September 2, 2004 http://www.dx21.com/SCRIPTING/RUNDLL32/REF...E.ASP?ISF=0&P=A Link to comment Share on other sites More sharing options...
ZenKensei Posted October 8, 2004 Share Posted October 8, 2004 Larry, Could you expound upon your comment of trapping the return code when using the "Net Stop" command to stop a service. As an example, stopping and then restarting the "Spooler" service. Obviously there should not be an attempt to restart the service until it has completed a stop. I would be interested in seeing an example of AutoIT using the return code to test a 'Pass' / 'Fail' type of scenario. Thanks, ZK Link to comment Share on other sites More sharing options...
emmanuel Posted October 8, 2004 Share Posted October 8, 2004 If you know you'll only be using WinXP ONLY, try the SC command (Service Controller). Use Windows Help (gasp!) and type A-Z in the search bar, and click on "Command-line reference A-Z" and then on the letter S at the top of the window. SC will be at the top of the list - click on it for the full reference.Jerry<{POST_SNAPBACK}>or, if you're not just using XP, try using SysInternals' PsService "I'm not even supposed to be here today!" -Dante (Hicks) Link to comment Share on other sites More sharing options...
BigDaddyO Posted October 8, 2004 Share Posted October 8, 2004 a friend of mine uses vbscripting to stop, verify, start, verify services. you could probable write a vbscript and then launch it with a runwait from autoit. Apparently vbscript will work on 2000, XP, 2003, and NT if scripting patch is installed. Link to comment Share on other sites More sharing options...
MattX Posted October 8, 2004 Share Posted October 8, 2004 http://www.dx21.com/SCRIPTING/RUNDLL32/REF...E.ASP?ISF=0&P=A<{POST_SNAPBACK}>Good lord, thats bookmarked for future reference !! Many Thanks. 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