Jump to content

Recommended Posts

Posted (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 by win2k
Posted

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)

Posted

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.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...