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.


In reply to Re: Control and Query Win32 Services at the command line by NetWallah
in thread Control and Query Win32 Services at the command line by jdporter

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.