Search code examples
windowsservice

cannot get sc.exe to work for my program


I am trying to follow this website and install a program we have as a service.

This is what I have:

SC CREATE SqlPort binPath= “D:\RPG\VbLib\SqlPort\SqlPort\srvstart.exe SqlPort -c D:\RPG\VbLib\SqlPort\SqlPort\sqlport.ini” DisplayName= SqlPort start= auto

When I hit enter, it gives me the help:

DESCRIPTION:
        Creates a service entry in the registry and Service Database.
USAGE:
        sc <server> create [service name] [binPath= ] <option1> <option2>...

OPTIONS:
NOTE: The option name includes the equal sign.
      A space is required between the equal sign and the value.
 type= <own|share|interact|kernel|filesys|rec>
       (default = own)
 start= <boot|system|auto|demand|disabled|delayed-auto>
       (default = demand)
 error= <normal|severe|critical|ignore>
       (default = normal)
 binPath= <BinaryPathName>
 group= <LoadOrderGroup>
 tag= <yes|no>
 depend= <Dependencies(separated by / (forward slash))>
 obj= <AccountName|ObjectName>
       (default = LocalSystem)
 DisplayName= <display name>
 password= <password>

I've compared the help to what I have and I don't see any problems with it. This is on a Windows 7 x64 system.

Anyone see what I am doing wrong?


Solution

  • You've got and in the pasted text. Might want to try replacing them with plain " quotes instead.