Sunday 25 March 2007

SC (Service Controller)

Common Uses - List all running services >

C:\>sc query
These tend to fly past pretty fast, hence pipe the results into a text file for later eg >

C:\>sc query >services.txt
To return data for just one service >

C:\>sc query "mssql$alpha" SERVICE_NAME: mssql$alpha TYPE : 10 WIN32_OWN_PROCESS STATE : 4 RUNNING (STOPPABLE,PAUSABLE,ACCEPTS_SHUTDOWN) WIN32_EXIT_CODE : 0 (0x0) SERVICE_EXIT_CODE : 0 (0x0) CHECKPOINT : 0x0 WAIT_HINT : 0x0

To delete a service (stop the service first) >

C:\>sc delete "Unwanted Service Name" [SC] DeleteService SUCCESS

Find it on Technet here >
http://technet2.microsoft.com/windowsserver2008/en/library/ac365f89-4b20-4de6-a582-b204c5e7d0eb1033.mspx?mfr=true

No comments: