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

respected monks,

before posting this I did a 'supersearch' with the title of th e node. but I did not find any result. So, I am going with my question here.
I am working in windows. how to access another windows machine using it's IP ? also I would like to read all the files available in each drive. what module I can use for this ?

Replies are listed 'Best First'.
Re: accessing another widows machine
by Smaug (Pilgrim) on Sep 27, 2006 at 11:00 UTC
    Maybe your seach was blank because you are trying to access a "widow's" machine?? (Sorry - could not resist)

    What are you trying to access? The file system?

    Smaug.
    <update....>
    Short of information I'm assuming you want to access a file share on a Windows machine, from another Windows machine. If that is the case, standard UNC paths should work.
    Try:
    #!/usr/bin/perl use strict; my $sharename="//servername/directory/";

    <update 2...>
    I think that Win32::NetResource might help you, but I can't get it installed to check. I'll post something if I get an answer to CPAN Module Compile Error

    Good luck!
    <Final update...>
    Ok, so the Win32 module will not install on Linux (duh!!). Luckily digger has supplied the code you need.
Re: accessing another widows machine
by digger (Friar) on Sep 27, 2006 at 18:53 UTC

    Win32::NetResource is indeed the module to use, assuming you are running from a Windows computer. It is included in the base install of ActiveState Perl, so no additional install is necessary.

    The following code will list all shared folders on MyHost

    use strict; use Win32::NetResource qw(:DEFAULT GetSharedResources GetError); if (GetSharedResources(my $resources, RESOURCETYPE_DISK, { RemoteName => "\\\\MyHost"})) { foreach my $href (@$resources) { print "-----\n"; foreach(keys %$href) { print "$_: $href->{$_}\n"; } } }

    HTH
    digger

A reply falls below the community's threshold of quality. You may see it by logging in.