Running remote commands on Windows

Discussion in 'Perl Misc' started by Filipe Bonjour, May 21, 2004.

  1. Hi,

    I'm writing a series of scripts to be run on a Windows 2000 server to
    control applications on a series of other Windows servers.

    Most commands to control the application are network-transparent. But we
    still need to launch from the controlling server some commands on the
    running servers. For instance we need to run tlist.exe to gather
    information on processes running remotely.

    I tried to find both generic modules for launching commands remotely (e.g.
    Net::Rsh) or more specific modules (e.g. Win32::process) but I haven't
    found anything 100% satisfactory. I also thought of building a small
    daemon running on the remote servers that would accepts requests, run
    tlist.exe and return the reply. (I was thinking Net::Daemon, because I
    don't know enough about Windows to write a server in C).

    Any thoughts would be appreciated!

    TIA,

    Filipe
    Filipe Bonjour, May 21, 2004
    #1
    1. Advertising

  2. Filipe Bonjour

    ! aaa Guest

    Win32::OLE and Win32::API are nice.

    perl can launch commands natively - system() - so you don't need anything
    else really.

    Here's how API does it tho:-

    $Shellex = new Win32::API("shell32", "ShellExecute",
    ['N','P','P','P','P','N'], 'I');
    my $result = $Shellex->Call( $handle, $operation, $file, $params, $dir,
    $show);
    return $result > 32;

    See MSDN for the SHellExecute FN doco.

    "Filipe Bonjour" <> wrote in message
    news:p...
    > Hi,
    >
    > I'm writing a series of scripts to be run on a Windows 2000 server to
    > control applications on a series of other Windows servers.
    >
    > Most commands to control the application are network-transparent. But we
    > still need to launch from the controlling server some commands on the
    > running servers. For instance we need to run tlist.exe to gather
    > information on processes running remotely.
    >
    > I tried to find both generic modules for launching commands remotely (e.g.
    > Net::Rsh) or more specific modules (e.g. Win32::process) but I haven't
    > found anything 100% satisfactory. I also thought of building a small
    > daemon running on the remote servers that would accepts requests, run
    > tlist.exe and return the reply. (I was thinking Net::Daemon, because I
    > don't know enough about Windows to write a server in C).
    >
    > Any thoughts would be appreciated!
    >
    > TIA,
    >
    > Filipe
    ! aaa, May 27, 2004
    #2
    1. Advertising

  3. "Filipe Bonjour" <> wrote in message
    news:p...
    > Hi,
    >
    > I'm writing a series of scripts to be run on a Windows 2000 server to
    > control applications on a series of other Windows servers.


    So am I (or trying to)...

    >
    > I tried to find both generic modules for launching commands remotely (e.g.
    > Net::Rsh) or more specific modules (e.g. Win32::process) but I haven't
    > found anything 100% satisfactory. I also thought of building a small
    > daemon running on the remote servers that would accepts requests, run
    > tlist.exe and return the reply. (I was thinking Net::Daemon, because I
    > don't know enough about Windows to write a server in C).


    The only application I found was psexec.exe available from sysinternals. I
    would prefer a complete Perl solution (without a system call to an external
    program like psexec, or having to install telnet or ssh servers). Please
    update us on the newsgroup if you have found something.

    Regards,

    Domenico
    Domenico Discepola, May 27, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Pfaff

    Re: man pages for C commands (GCC commands)

    Ben Pfaff, Jun 24, 2003, in forum: C Programming
    Replies:
    4
    Views:
    3,952
    Thomas Stegen
    Jun 28, 2003
  2. Tim Stanka
    Replies:
    1
    Views:
    785
    Jeff Epler
    Aug 2, 2004
  3. Cameron Laird
    Replies:
    0
    Views:
    2,068
    Cameron Laird
    Dec 29, 2008
  4. Bruce Horrocks
    Replies:
    3
    Views:
    255
    Bruce Horrocks
    Jan 1, 2004
  5. Sol Linderstein
    Replies:
    2
    Views:
    157
    A. Sinan Unur
    Jun 1, 2004
Loading...

Share This Page