User Tools

Site Tools


microsoft:cli:command-line-sc

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
microsoft:cli:command-line-sc [2023/03/10 06:50] – created rpleckomicrosoft:cli:command-line-sc [2023/03/10 06:56] (current) rplecko
Line 6: Line 6:
   wmic service where "name like 'dhcp%'" list status   wmic service where "name like 'dhcp%'" list status
      
 +CMD replies:
  
 +<code>
 +C:\Work_Dir\VoIP\DHCP server>wmic service where "name like 'dhcp%'" list status
 +ExitCode  Name        Status
 +0         Dhcp        OK
 +0         DHCPServer  OK
 +</code>
 +So there is a service called "DHCPServer running on the computer
 +Let's stop it...
 +
 +  sc stop DHCPServer
 +
 +CMD replies:
 +
 +<code>
 +SERVICE_NAME: DHCPServer
 +        TYPE               : 10  WIN32_OWN_PROCESS
 +        STATE              : 3  STOP_PENDING
 +                                (STOPPABLE, NOT_PAUSABLE, IGNORES_SHUTDOWN)
 +        WIN32_EXIT_CODE    : 0  (0x0)
 +        SERVICE_EXIT_CODE  : 0  (0x0)
 +        CHECKPOINT         : 0x4
 +        WAIT_HINT          : 0x0  
 +</code>
 +
 +Now we can delete the service
 +
 +  sc delete DHCPServer
 +
 +and the CMD replies:
 +
 +<code>
 +[SC] DeleteService SUCCESS
 +</code>
  
microsoft/cli/command-line-sc.1678431005.txt.gz · Last modified: 2023/03/10 06:50 by rplecko