December 2012
Intermediate to advanced
488 pages
10h 23m
English
To communicate with the Service Control Manager, you can use a command-line tool called sc.exe. Note that you ought to be logged in as an administrator before running this utility. To register our executable as a service, we'll use its create command. Every service gets a behind-the-scenes short name such as testsvc. Specify the new name as the first parameter to create. The binPath parameter sets the path to the executable. Be sure that the equal sign has no spaces before it and one after it. Follow this convention with all sc.exe parameters that use an equal sign.
sc create testsvc binPath= "C:\WindowsService1.exe"
On Windows 8, this requirement of having a space after the equals sign has been removed.
After running this command, ...
Read now
Unlock full access