Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 692
  • Last Modified:

start/stop services from DOS prompt

are commands available for the above?

thanks
0
anushahanna
Asked:
anushahanna
  • 4
  • 3
  • 2
  • +2
6 Solutions
 
KenMcFCommented:
You can use net start and net stop

net start SERVICE
net stop SERVICE

To restart
net stop SERVICE && net start SERVICE
0
 
nimda7Commented:
   net stop <service_name>

    net start <service_name>
0
Making Bulk Changes to Active Directory

Watch this video to see how easy it is to make mass changes to Active Directory from an external text file without using complicated scripts.

 
anushahannaAuthor Commented:
thanks - is stop and immediate restart ok, or better to give a pause?
0
 
KenMcFCommented:
Using
net stop SERVICE && net start SERVICE
it will wait until the serivce is stopped and then continue with the start.
0
 
anushahannaAuthor Commented:
there is a display name and then a service name.. i assume i am to choose the second one?
0
 
c_a_n_o_nCommented:
Another command that can be used is the SC command, it is extremely flexible beyond the stop and start service.

SC stop SERVICE
SC start SERVICE

http://support.microsoft.com/kb/251192
http://ss64.com/nt/sc.html
0
 
c_a_n_o_nCommented:
use the Service name
0
 
anushahannaAuthor Commented:
c_a_n_o_n, what benefit do you envision using SC over NET ?

can you combine both statements into one with SC, like with NET
0
 
KenMcFCommented:
if you are looking for other options you can do this using powershell to

get-serivce w32time | Stop-service
get-serivce w32time | Start-service

(gwmi win32_service | where {$_.name -eq "w32time"}).startservice
(gwmi win32_service | where {$_.name -eq "w32time"}).stopservice

There are a lot of other options you can do here as well.

$b = gwmi win32_service | where {$_.name -eq "w32time"}

To find all the options for this
$b | Get-member


0
 
anushahannaAuthor Commented:
Thanks very much for the options available.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 4
  • 3
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now