win2k Posted August 8, 2006 Share Posted August 8, 2006 (edited) I just use this to start and stop windows services but i was wondering what would be better to use. #include <_NTServices.au3> $Stopstatus = _ServiceStop( _ToInternalServiceName("DVFaxNotifyServer") ) sleep(300) $Startstatus = _ServiceStart( _ToInternalServiceName("DVFaxNotifyServer") ) sleep(300) or #include <process.au3> $rc = _RunDos("sc stop DVFaxNotifyServer") $rc = _RunDos("sc start DVFaxNotifyServer") I was just wondering which snippet of code usually works better. I can add the code here for the #include files if needed. Edited August 8, 2006 by win2k Link to comment Share on other sites More sharing options...
evilertoaster Posted August 8, 2006 Share Posted August 8, 2006 I would just use "RunWait(@ComSpec & " /C sc stop DVFaxNotifyServer", "", @SW_HIDE)". If your not using any other functions from those libraries it might save alot of overhead...especailly since the _RunDos UDF is just 1 line (as shown above) Link to comment Share on other sites More sharing options...
win2k Posted August 8, 2006 Author Share Posted August 8, 2006 well this actually is part of a scheduled task so it runs when the user is logged out and just runs in the background, so i will have to check into that at work and test it out on our test servers. Link to comment Share on other sites More sharing options...
evilertoaster Posted August 8, 2006 Share Posted August 8, 2006 It is a direct copy of the _RunDos command (or rather _RunDos is a direct copy of that as mentioned in the AutoIt FAQs). if you where gona use that there should be no problem 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