1. Identify the services name
C:\>sc query | findstr -i themes
SERVICE_NAME: Themes
DISPLAY_NAME: Themes
2. Check the service “Status”. In this case, service “themes” is RUNNING
C:\>sc query themes
SERVICE_NAME: themes
TYPE : 20 WIN32_SHARE_PROCESS
STATE : 4 RUNNING
(STOPPABLE,NOT_PAUSABLE,ACCEPTS_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
C:\>
3. Check the service “Startup Type”. In this case, startup type for themes service is AUTO_START
C:\>sc qc themes
[SC] GetServiceConfig SUCCESS
SERVICE_NAME: themes
TYPE : 20 WIN32_SHARE_PROCESS
START_TYPE : 2 AUTO_START
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : C:\WINDOWS\System32\svchost.exe -k netsvcs
LOAD_ORDER_GROUP : UIGroup
TAG : 0
DISPLAY_NAME : Themes
DEPENDENCIES :
SERVICE_START_NAME : LocalSystem
C:\>
4. Stop the service. Notice that the state is STOPPED after we run the sc stop themes.
C:\>sc stop themes
SERVICE_NAME: themes
TYPE : 20 WIN32_SHARE_PROCESS
STATE : 1 STOPPED
(NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
C:\>
5. Change the startup type to disable
C:\>sc config themes start= disabled
[SC] ChangeServiceConfig SUCCESS
C:\>
6. Verify the status again
sc query themes
sc qc themes
C:\> sc query themes
SERVICE_NAME: themes
TYPE : 20 WIN32_SHARE_PROCESS
STATE : 1 STOPPED
(NOT_STOPPABLE,NOT_PAUSABLE,IGNORES_SHUTDOWN)
WIN32_EXIT_CODE : 0 (0x0)
SERVICE_EXIT_CODE : 0 (0x0)
CHECKPOINT : 0x0
WAIT_HINT : 0x0
C:\> sc qc themes
[SC] GetServiceConfig SUCCESS
SERVICE_NAME: themes
TYPE : 20 WIN32_SHARE_PROCESS
START_TYPE : 4 DISABLED
ERROR_CONTROL : 1 NORMAL
BINARY_PATH_NAME : C:\WINDOWS\System32\svchost.exe -k netsvcs
LOAD_ORDER_GROUP : UIGroup
TAG : 0
DISPLAY_NAME : Themes
DEPENDENCIES :
SERVICE_START_NAME : LocalSystem
C:\>
REFERENCE:
https://www.netspi.com/blog/entryid/116/penetration-testing-stopping-an-unstoppable-windows-service
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/sc.mspx?mfr=true