Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much

Simple Windows32 Question

by jarthda (Acolyte)
on Dec 14, 2007 at 23:02 UTC ( #657136=perlquestion: print w/replies, xml ) Need Help??
jarthda has asked for the wisdom of the Perl Monks concerning the following question:

How do I make perl logon to a remote windows machine and run a cmd line?

Replies are listed 'Best First'.
Re: Simple Windows32 Question
by shmem (Chancellor) on Dec 15, 2007 at 00:22 UTC
    You instruct it to do so, which generally includes writing a script for perl to read and execute.

    Obstacles encountered on the way are generally solved reading the documentation and using CPAN. A good understanding of TCP/IP is beneficial.

    See also: How (Not) To Ask A Question


    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
Re: Simple Windows32 Question
by NetWallah (Canon) on Dec 15, 2007 at 00:54 UTC
    Depending on how complex your task is, look into psexec, or the rcmd service that was with old resource kits. In the w2000 days, there was even a telnet service, not sure of current status.

    On the perl (controlling) side, if you get the telnet service enabled, you can use the Net::Telnet module, or use backticks for psexec or rcmd.

         "As you get older three things happen. The first is your memory goes, and I can't remember the other two... " - Sir Norman Wisdom

Re: Simple Windows32 Question
by Corion (Pope) on Dec 15, 2007 at 09:03 UTC

    You can also use the WMI (via Win32::WQL for example, written by me) to remotely launch a process. This will require that you have the appropriate privileges and that DCOM is not disabled in your network.

Re: Simple Windows32 Question
by strat (Canon) on Dec 15, 2007 at 10:23 UTC

    As a lowlevel way, you can also add something to the remote scheduler with the command:

    at \\nodename ....

    (see: help at for more information

    If you have problems with the parameters, there exists a freeware program with name WinAt (you can easily find it with google

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8."

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://657136]
Approved by ikegami
and nobody stirs...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (9)
As of 2018-02-22 12:45 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (292 votes). Check out past polls.