arunmep has asked for the wisdom of the Perl Monks concerning the following question:

Hi Guys, I have a standalone perl program runnnig in windows and displays the drive letters. I need to find the drive letters of a remote machine by using the IP address provided by the user. the program should connect to the remote machine and retrieve the drive letters is it possible.please let me know
  • Comment on How to run a perl pgm in remote machine

Replies are listed 'Best First'.
Re: How to run a perl pgm in remote machine
by liverpole (Monsignor) on Nov 07, 2006 at 14:28 UTC
    Hi arunmep,

    The answer will depend on how you connect to the remote machine manually.

    Do you telnet to it?  Then try Net::Telnet.

    Do you have to ssh to it?  Perhaps Net::SSH is what you need.

    If it's some more complicated method, you may want to look into using Expect.


    s''(q.S:$/9=(T1';s;(..)(..);$..=substr+crypt($1,$2),2,3;eg;print$..$/
Re: How to run a perl pgm in remote machine
by Smaug (Pilgrim) on Nov 07, 2006 at 14:42 UTC
    Hi,

    I'm not sure I exactly understand what you're asking. The question seems to point to running a perl program on a remote machine, i.e. execute it remotely? but in your question you seem to indicate that this will run locally and connect to a remote machine.

    As already said, the lack of OS information makes this a little difficult, but assuming it's Win32 you may want to use WMI. If that's the case, take a look at Re: how to identify the windows drives.

    Otherwise, try a SuperSearch for WMI.

    Regards,
    Smaug.
    Update:
    Also see the original question in the thread mentioned: how to identify the windows drives
Re: How to run a perl pgm in remote machine
by davorg (Chancellor) on Nov 07, 2006 at 14:28 UTC

    (Please don't use abbreviations like "pgm" in subjects - it makes it harder to read.)

    It is almost certainly possible. But we can't give you any really useful advice without knowing what operating systems are running on the two machines and how they are networked together.

    --
    <http://dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Re: How to run a perl pgm in remote machine
by themage (Friar) on Nov 07, 2006 at 14:41 UTC
Re: How to run a perl pgm in remote machine
by Firefly258 (Beadle) on Nov 08, 2006 at 05:59 UTC
    using strict; I don't think this is a question related to perl at all but anyway..

    http://www.roth.net has a good collection of perl scripts and tutorials to leverage WMI to gather information from local or remote machines.

    Logical Disk information such as drive letters and mount points is found under the LOGICALDISK WMI class/alias. Like in this shell command..
    c:\> WMIC.exe LogicalDisk
    Figuring out how to use perl to access WMI remotely should be your task, it's not too hard there's plenty of code that already does it, all that needs doing is tweaking it to do just exactly what you need.

    P.S: Also, have a look at the WMI Code Creator and Scriptomatic tools from M$, they have some perl code generators that possibly do just what you need.