Note: Windows services put the process or program in the system account by default.
Here is an example:
cmd /c sc create test1 binPath= "cmd /c start calc" type= own type= interact & net start test1 & sc delete test1
1. sc.exe: Manages windows services.
2. net start/net stop: Starts or stops a service.
3. cmd.exe runs application under dos (needed if run in windows instead of command prompt).
The "&" in a dos command allows another command on same line.
4. Variables in this case: "test1": Any un-used service name.
"calc": Is the windows caculator(calc.exe)
Could be any other program or the command prompt window itself.
5. sc delete "test1": deletes the service in the above command so it only runs as a service in this above session.
Note: This has been tested on Windows XP and Windows Vista but not other other Windows Systems.
Thanks for visiting mswintips.com.
Return to Index Page
Copyright ©2019 CSN All Rights Reserved