Link to home
Start Free TrialLog in
Avatar of AnnaBZ
AnnaBZ

asked on

Getting status of a service with VB or Win API

Hi Guys,
I need to start and stop a service from VB code ,but first of all I need to get its status and depending on the result start or stop it . I do the start or stop with Shell command

SrvName="ServiceName"
Shell "cmd.exe /c net stop " & SrvName
or
Shell "cmd.exe /c net start " & SrvName

any help or better the code will be really appreciated
ASKER CERTIFIED SOLUTION
Avatar of AlexFM
AlexFM

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of AnnaBZ
AnnaBZ

ASKER

Thanks a lot .I found there all nesessary information and even much more