User Tools

Site Tools


microsoft:cli:command-line-sc

This is an old revision of the document!


Find and delete the service

A rugue DHCP is running on my PC as a service. Let's find the service name, stop and delete it First let's find the service with name containing “dhcp”…

wmic service where "name like 'dhcp%'" list status

CMD replies:

C:\Work_Dir\VoIP\DHCP server>wmic service where "name like 'dhcp%'" list status
ExitCode  Name        Status
0         Dhcp        OK
0         DHCPServer  OK

So there is a service called “DHCPServer running on the computer Let's stop it…

sc stop DHCPServer

CMD replies:

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  
microsoft/cli/command-line-sc.1678431282.txt.gz · Last modified: 2023/03/10 06:54 by rplecko