Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Control and Query Win32 Services at the command line

by NetWallah (Canon)
on Jan 12, 2006 at 22:05 UTC ( #522817=note: print w/replies, xml ) Need Help??


in reply to Control and Query Win32 Services at the command line

This looks like a rewrite of the NETSVC command from the Win2K resource kit, but it is missing the "remote host" option, that allows you to control services on other machines. Your code appears to prepared to easily include that option too.
NETSVC.exe (Resource Kit) Command-line Service Controller. Start, Stop and Query services, but d +oes not cover creating or deleting them. Although part of the Windows 2000 resource kit - this command runs fin +e under NT 4. Syntax NETSVC \\server command servicename Key server The workstation or server where the service is runnin +g servicename The Name of the service, unlike the SC command this w +ill accept either the DisplayName or the service name commands: /list Lists installed services. Omit servicename with this + command. /query Query the status of a service. /start Start the specified service. /stop Stop the specified service. /pause Pause the specified service. /continue Restart a paused service. Arguments can be specified in any order: NETSVC /query \\Server299 "DHCP Client" NETSVC "DHCP Client" \\Server299 /query

     You're just jealous cause the voices are only talking to me.

     No trees were killed in the sending of this message.    However, a large number of electrons were terribly inconvenienced.

Replies are listed 'Best First'.
Re^2: Control and Query Win32 Services at the command line
by jdporter (Canon) on Jan 12, 2006 at 22:13 UTC

    Surely. Of course the same thing could be done using the standard M$ tools.

    But: a. this is Perl, which means it's better;-) and b. you can write a whole stop/wait/start or pause/wait/resume script on one line, even for a chain of dependent services. Heck, you could even use it as a "better pause" command. :-)

    We're building the house of the future together.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://522817]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (7)
As of 2018-10-18 21:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (105 votes). Check out past polls.

    Notices?