Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

NET STOP a Service Running on Server from Another Machine

Posted on 2009-05-13
9
Medium Priority
?
1,839 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 500 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Workplace bullying has increased with the use of email and social media. Retain evidence of this with email archiving to protect your employees.
The article will include the best Data Recovery Tools along with their Features, Capabilities, and their Download Links. Hope you’ll enjoy it and will choose the one as required by you.
This tutorial will walk an individual through locating and launching the BEUtility application to properly change the service account username and\or password in situation where it may be necessary or where the password has been inadvertently change…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…
Suggested Courses

963 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