Solved

NET STOP a Service Running on Server from Another Machine

Posted on 2009-05-13
9
1,787 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
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 
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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

How to fix error ""Failed to validate the vCentre certificate. Either install or verify the certificate by using the vSphere Data Protection Configuration utility" when you are trying to connect to VDP instance from Vcenter.
How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
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…

831 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