Sign in to follow this  
Followers 0
ZenKensei

Determine state of a service?

2 posts in this topic

Group,

Working on a script to troubleshoot Microsoft's SMS Advanced client installation. The installation of advanced client relies on multiple factors such as the Admin$ share being accessable, the Server service being started, etc. So here's my problem. I know I can start & stop services inside AutoIt using something like:

$ServerStart = RunWait(@ComSpec & " /c " & 'net start Server', "", @SW_HIDE)

However, is there a way to query for the current state of the service so I don't have to blindly use the 'net start' and 'net stop' command? Say, using either a DLLCall function or an external program like PSService. I have nothing against using PSService if necessary, but if I use PSService how do I check the %State% variable once I run PSService query Server to see if the service is started?

Thanks in advance for any advice,

ZK

Share this post


Link to post
Share on other sites



Group,

    Working on a script to troubleshoot Microsoft's SMS Advanced client installation. The installation of advanced client relies on multiple factors such as the Admin$ share being accessable, the Server service being started, etc. So here's my problem. I know I can start & stop services inside AutoIt using something like:

$ServerStart = RunWait(@ComSpec & " /c " & 'net start Server', "", @SW_HIDE)

    However, is there a way to query for the current state of the service so I don't have to blindly use the 'net start' and 'net stop' command? Say, using either a DLLCall function or an external program like PSService. I have nothing against using PSService if necessary, but if I use PSService how do I check the %State% variable once I run PSService query Server to see if the service is started?

Thanks in advance for any advice,

ZK

<{POST_SNAPBACK}>

Route the commandline output to a txt file and read it with autoit.

Lofting the cyberwinds on teknoleather wings, I am...The Blue Drache

Share this post


Link to post
Share on other sites

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
Sign in to follow this  
Followers 0