Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

stop/start service remotely

Status
Not open for further replies.

BenJMF

IS-IT--Management
Jan 30, 2006
53
US
I want to be able to stop and then start a service on a remote computer. I tried saving a batch file on the remote computer and then using \\computername\C$ to browse to the batch but when it is executed, it affects my computer and not the remote.

I've been reading about netsvc but this appears to be for W2K and not for XP, which I am running.

Any ideas what I'm doing wrong or if this is possible with XP?
 
Access the remote PC via RDP and then run the service.

"Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy"
Albert Einstein
 
I've thougth of that but I'd rather not use RDP unless absolutely necessary.
 
I guess you need to ask yourself then: How necessary is it that you start and stop that service remotely? RDP is probably the simplest solution for what your trying to do. I suppose you could put the batch file on the users desktop then contact them by phone or via net send and instruct them to run it.

If you can elaborate some on exactly what your trying to accomplish, then myself or others may be able to offer a better solution.

"Once you can accept the universe as matter expanding into nothing that is something, wearing stripes with plaid comes easy"
Albert Einstein
 
Can you do anything with the RunAs command?

See what you can gather about RunAs from this location which will show you the full Syntax when %Windir%\Help\ntcmds.chm is used in the Start Run box. Look for RunAs via "Command-line reference A-Z", under "R".

294676 - HOW TO: Enable and Use the "Run As" Command When Running Programs in Windows


RunAs not working
thread779-828070

Free Tools Save Hours
 
On your workstation right click on My Computer and click on Manage. Click on Action ->Connect to another computer and type in the name of the remote computer.

Assuming that you're logged onto your workstation as an admin or, if you're logged in as someone else, that you have permission to access the remote computer then you can manage the services (and anything else in Computer Management) remotely and the user of the remote computer won't even know you're there.

Cheers.
 
Thanks cmeagan656, your suggestion works great.

linney, Thanks for your suggestions yesterday and the heads up this morning on the "Access denied" message. Fortunately I'm not having a problem. I tried it both ways. SP1 remotely managing SP2 and SP2 remotely managing SP1 and I'm not having any problems but I'll keep that in mind if it happens in the future.

Thanks everyone for your help. Once again the helpful tek-tips users have gotten me on the right track.
 
I wouldn't get into the habit of using the computer management. It would be beneifcial to use cmd line arguaments this will help you in the future if you need to do vbscripting or do linux administration.

I use cmd line since it allows me to see what is going on and helps me learn.


1) download psService and place into your system32 folder
run this command from the command line
psservice \\computername -u johndoe -p foo stop printer spooler

you could user restart stop etc...

or

2)the Microsfot way us SC
from the cmd prompt type sc \\servername stop schedule

more info here or just type sc in the cmd prompt
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top