// // Leave a Comment

[Guide] How to run Program As Service in Windows 8, Windows 8.1 and Windows Server 2012


Sometime Administrator needs to create Services from existing executable files, Its very easy to create Service from exe file and for that we need to use command SC.
What is SC?
SC Communicates with the Service Controller and installed services. SC.exe retrieves and sets control information about services. You can use SC.exe for testing and debugging service programs. Service properties stored in the registry can be set to control how service applications are started at boot time and run as background processes. SC.exe parameters can configure a specific service, retrieve the current status of a service, as well as stop and start a service. You can create batch files that call various SC.exe commands to automate the startup or shutdown sequence of services. SC.exe provides capabilities similar to Services in the Administrative Tools item in Control Panel.


To create Service from executable run below command,
C:\Program Files (x86)\Xerox\NetworkScan>sc create XeroxScan binpath="C:\Program
Files (x86)\Xerox\NetworkScan\NSCSysUI_XEROX.exe"


Note - must have quotation marks around the actual exe path.
 
How to run Program As Service in Windows 8, Windows 8.1 and Windows Server 2012 01
Now you can see the created new service from exe file,

How to run Program As Service in Windows 8, Windows 8.1 and Windows Server 2012 02
If you want to delete or remove created service just run below command as shown,
C:\Program Files (x86)\Xerox\NetworkScan>sc delete XeroxScan binpath="C:\Program
Files (x86)\Xerox\NetworkScan\NSCSysUI_XEROX.exe"

 How to run Program As Service in Windows 8, Windows 8.1 and Windows Server 2012 03