Solved

NET STOP a Service Running on Server from Another Machine

Posted on 2009-05-13
9
1,789 Views
Last Modified: 2013-12-01
I have a computer (windows 2003 server) from which I want to run a batch file and part of that batch file is to stop a service running on another computer (normally accessed by: \\computersname.)  I've tried this syntax:

\\computername net stop "servicename"

and got error message that directory, filename or syntax incorrect

and I've tried

net stop "servicename" \\computername

and get the error message that the synax of this command is:
NET STOP
Service

I can run the net stop command on the server machince locally, but I need to run it from a different computer and am perplexed what I'm doing wrong here.

Anyone with thoughts on this?
0
Comment
Question by:tklingman
  • 2
  • 2
  • 2
  • +2
9 Comments
 

Expert Comment

by:qzart
ID: 24381789
try the sysinternals (microsoft)  psexec.exe  tool

http://technet.microsoft.com/en-us/sysinternals/bb896649.aspx


psexec.exe \\Server Net Stop "Service"

Open in new window

0
 
LVL 17

Accepted Solution

by:
OriNetworks earned 125 total points
ID: 24381989
you can also try the SC command line utility http://technet.microsoft.com/en-us/library/bb490995.aspx

You can remotely start or stop services on remote servers using

sc \\myserver stop myservice
0
 

Expert Comment

by:qzart
ID: 24382008
That is the command I was trying to think of.   Good Call
0
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
LVL 6

Expert Comment

by:BALMUKUND KESHAV
ID: 24382108
By default Messenger Service is disabled in Win'XP. Pl. make sure Messenger Service in Enabled on remote pc whose service do you want to start/stop remotely.
Until You don't enable Messanger Service in Windows your Net send command will not start/stop service on remote PC.

Best of luck..

Bm keshav

0
 
LVL 95

Expert Comment

by:Lee W, MVP
ID: 24382535
To be clear, the NET command doesn't offer remote system control.  SC does.  Use SC.
0
 
LVL 17

Expert Comment

by:OriNetworks
ID: 24391662
@BMKESHAV  i dont see how messenger service is related.
0
 
LVL 6

Expert Comment

by:BALMUKUND KESHAV
ID: 24392124
Sorry I was wrong,
You can do like this :

sc \\computername start servicename

Pl.also see the attached txt file having inst.for how to use start/stop service on remote pc using vb.net project.


start-stop-service.txt
0
 

Author Comment

by:tklingman
ID: 24397217
Thank you all for your input - all gave me things to think about, explore etc.  Turns out that the sc command worked like a dream!
0
 

Author Closing Comment

by:tklingman
ID: 31581314
Thank you very much for taking the time to answer my question, it saved me time from looking at other options.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question