List of all running services:
cmd> net start cmd> tasklist /svc
List of all services:
cmd> sc query
List of specific service:
cmd> sc query NAME
GUI tool:
cmd> services.msc
cmd> net start NAME cmd> sc start NAME cmd> net stop NAME cmd> sc stop NAME cmd> services.msc
In order to create service from any executable use srvany.exe from Windows Resource Kits 2003 (take attention to spaces after =):
cmd> sc create NAME binPath= "c:\Program Files\Windows Resource Kits\Tools\srvany.exe" ^ type= own start= auto error= normal DisplayName= "NAME for services.msc"
Then pass what srvany.exe wrapper to do:
cmd> reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NAME\Parameters" ^ /v "Application" ^ /d "\"c:\Program Files\Java\jre7\bin\java.exe\" -cp c:\home\devel\service Main"
Above you see quoting syntax for spaces and quotes. Next start service with:
cmd> sc start NAME
If you make error recheck your settings with:
cmd> reg query "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\services\NAME" /s
Or remove service and make steps again:
cmd> sc delete NAME
Visit GUI services.msc and check with procexp.exe that service actually do job.
cmd> sc delete NAME