Solved

NET STOP a Service Running on Server from Another Machine

Posted on 2009-05-13
9
1,774 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
 
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
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 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

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to do a bare metal restore 18 70
data center consolidation 8 91
Backup fail due to VSS errors. 4 87
How do you feel about Carbonite and it's Partner Program? 1 73
By default, Carbonite Server Backup manages your encryption key for you using Advanced Encryption Standard (AES) 128-bit encryption. If you choose to manage your private encryption key, your backups will be encrypted using AES 256-bit encryption.
Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
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 show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now