WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: simonf on August 08, 2017, 05:28:22 PM

Title: wntSvcStatus Error 605
Post by: simonf on August 08, 2017, 05:28:22 PM
I am unable to read service status using wntSvcStatus on windows 10 or windows 2008r2, I get an extender error 605:  Is there any known issues with this function?

I can list the services using wntSvcList though...

; Load Appropriate Extender
AddExtender('wwwnt34i.dll',0,'wwwnt64i.dll')

state = wntSvcStatus("", "Spooler", 0, 2) ; get the current state of the Spooler
service
Switch state
   Case 1
      message("stopped","service is stopped")
      Break
   Case 4
      message("started","service is running")
      Break
EndSwitch
Exit

Title: Re: wntSvcStatus Error 605
Post by: td on August 08, 2017, 07:30:25 PM
Use 1000 instead of 0 in the third parameter.  You will have to ask Microsoft why.
Title: Re: wntSvcStatus Error 605
Post by: simonf on August 09, 2017, 04:17:30 PM
Thank you sir, all good now.