NET STOP a Service Running on Server from Another Machine

Posted on 2009-05-13
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:

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?
Question by:tklingman
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
  • +2

Expert Comment

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

psexec.exe \\Server Net Stop "Service"

Open in new window

LVL 17

Accepted Solution

OriNetworks earned 125 total points
ID: 24381989
you can also try the SC command line utility

You can remotely start or stop services on remote servers using

sc \\myserver stop myservice

Expert Comment

ID: 24382008
That is the command I was trying to think of.   Good Call
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.


Expert Comment

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

LVL 96

Expert Comment

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

Expert Comment

ID: 24391662
@BMKESHAV  i dont see how messenger service is related.

Expert Comment

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 project.


Author Comment

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!

Author Closing Comment

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

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
This article shows how to use a free utility called 'Parkdale' to easily test the performance and benchmark any Hard Drive(s) installed in your computer. We also look at RAM Disks and their speed comparisons.
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…
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…

635 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