wntSvcCreate Error 531
Keywords: wntsvccreate 531 invalid parameter
Question:
Can you help me with this piece of code? This was taken right out of the Help example. The only thing I changed was the "BinaryPathName", "ServiceStartName" and "Password" to an account that I know is on my local workstations User group. I keep getting an Error 531.AddExtender("WWWNT34i.DLL") ServiceName="Computer Browser" DisplayName="Browser" BinaryPathName="C:\svcs\Listener.exs" LoadOrderGroup="" ServiceStartName="newtest" Password="hello" createstring=Strcat(ServiceName,"|",DisplayName,"|",BinaryPathName,"|",LoadOrderGroup,"|",ServiceStartName,"|",Password) ServiceType=256|16 StartType=3 ErrorControl=0 createflags=strcat(ServiceType,"|",StartType,"|",ErrorControl) wntSvcCreate("", createstring, createflags, "","") Message("Done","Added a service to the service control manager database.") exitAnswer:
First try closing, then re-opening the service manager. I have found if you have the service amanger open while running the script, the service doesn't show up until you close and re-open the service manager applet.My guess is that the service has already been added. I like to add a check to the beginning of my script to delete the existing service before attempting to create it, to avoid this type of problem....
ret = wntSvcStatus("", ServiceName, 0, 0) if ret==@TRUE wntSvcDelete( "", ServiceName, 1000) Endif
Article ID: W15209