본문 바로가기

UNIX/etc

서비스 콘솔창에서 죽이고 살리기 명령어로

NET.exe

The NET Command is used to manage services as follows:

Syntax
      NET START [service]
      NET STOP [service]
      NET PAUSE [service]
      NET CONTINUE [service] 
   
Key
   service : The service name as shown in Control Panel, Services

To list the basic Services:

NET HELP SERVICES

To list the running Services:

NET START

If you try to start a service that is already running you will get this error message:

"The requested service has already been started. More help is available by typing NET HELPMSG 2182"

You can redirect and FIND this type of error as follows:

NET START alerter 2>&1|FIND "2182"
IF errorlevel 1 goto :sub_already_started


Related:


NET - Manage network resources
MODE - Configure a system device
SC - Service Control
PsService - View and control services
WMIC SERVICE - WMI access to services.
List of Windows Services
Powershell:
Get-Service - Get a list of services
New-Service - Create a new service
Restart-Service - Stop and then restart a service
Resume-Service - Resume a suspended service
Set-Service - Change the start mode/properties of a service
Start-Service - Start a stopped service
Stop-Service - Stop a running service
Equivalent bash command (Linux): start-stop-daemon - start and stop system daemon programs

출처 : http://www.ss64.com/nt/net_service.html