Wednesday, January 16, 2019

SC command to config and query Windows services remotely

Command to remotely change service setting from  Disbale to Delayed Auto

sc \\XXXXX config "Wsearch" start=delayed-auto

Command to remotely check the service status
  
sc \\XXXXX query wsearch

SERVICE_NAME: wsearch
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 1  STOPPED
        WIN32_EXIT_CODE    : 1077  (0x435)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

Command to remotely start the service status

sc \\XXXXX start wsearch

SERVICE_NAME: wsearch
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 2  START_PENDING
                                (NOT_STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x1
        WAIT_HINT          : 0x7530
        PID                : 1520
        FLAGS              :


No comments:

Post a Comment