Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
Remotely Start Windows Service
Name: fixitwright Date: February 21, 2006 at 05:38:56 Pacific OS: WIN2K/WIN2K3 CPU/Ram: various Product: various
Comment:
Hi All,
I have the need to set a windows service to Automatic and start that same service on multiple computers. I was wondering if there could be a script/ batch created for this rather then vist each computer. I'm new to scripting so if there is a way I need some help figuring it out.
Name: SN Date: February 21, 2006 at 08:23:57 Pacific
Reply:
You can do this via WMI, and use WMI via either VBScript (lots of examples out there) or .NET (a little easier for experienced programmers, but probably not for a beginner.)
There were some articles out there that required subscriptions that sounded like what you wanted (This one looked pretty good, and they offer a free 30-day trial), but the only free promising discussion a quick search revealed was this one. (note that the last example uses ADSI, which is a technology I haven't used much, instead of WMI to get the same thing done.)
Google for WMI tutorials and look through some simple examples, then move on to the Win32_services object and see what properties and methods are available for you to manipulate it.
Good luck, -SN
0
Response Number 2
Name: shahramsh Date: February 23, 2006 at 15:47:07 Pacific
Reply:
use sc command type sc/? to get the command options help,
if you are a domain admin you can use this command to do whatever you want about the services on the remote computer.
Summary: I am writing a windows service which uses JNI to launch a Java program (this shouldn't make a difference to my problem I don't think). I have my service set to auto start, which according to the API ...