?
Solved

NET STOP a Service Running on Server from Another Machine

Posted on 2009-05-13
9
Medium Priority
?
1,832 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
[X]
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
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

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

This article is an update and follow-up of my previous article:   Storage 101: common concepts in the IT enterprise storage This time, I expand on more frequently used storage concepts.
Create your own, high-performance VM backup appliance by installing NAKIVO Backup & Replication directly onto a Synology NAS!
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
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…

718 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