Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to start/stop services via command line 1

Status
Not open for further replies.
Apr 18, 2003
250
US
Is there a way to stop and start services via a command line? Or maybe via a batch file? I don't see any commands in the standard install of Windows 2000 svr...
 
At a command prompt type:

Net help start
net help stop

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Yeah, figures. I am never good at searching. Always get what I don't want.


Thanks for your help!
 
I usually start as descriptive as possible (in this case I use d "start a service from the command line") then take pieces off the search string until I get what I want.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
You can sc.exe from the resource kit, which is much more powerful than that net start/stop method. You can even use it to start/stop/configure services on remote machines.

Pat Richard, MCSE(2) MCSA:Messaging, CNA(2)
 
and with the native command you can configure a restart like this:

net stop servicename & net start servicename

The above will wait for the service to stop then restart it.

I hope you find this post helpful.

Regards,

Mark
 
According to Google it is probably in every resource kit since NT, but I know it is in 2k.

[red]"... isn't sanity really just a one trick pony anyway?! I mean, all you get is one trick, rational thinking, but when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick[/red]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top