timtrust123
Programmer
I have spent this sunny afternoon in London trying to get perl to link up to a network share (NT Server) and simply lits the files in the shares root directory. My investigation so far tells me that Net resource is the way to go and I even get a sucess when connecting. However i'm unable to list the files on the share. Its not a permissions problem (been there). Any ideas out there . Here is my code...
use Win32::NetResource;
my %NetResource = (
RemoteName => "\\\\server\\hiddenshare\$"
);
my $user = "user";
my $password = "password";
if (Win32::NetResource::AddConnection(\%NetResource, $password, $user, 1))
{
print "Connection made\n";
foreach $file (<*>){print "$file\n"};
}
Cheers
Tim
use Win32::NetResource;
my %NetResource = (
RemoteName => "\\\\server\\hiddenshare\$"
);
my $user = "user";
my $password = "password";
if (Win32::NetResource::AddConnection(\%NetResource, $password, $user, 1))
{
print "Connection made\n";
foreach $file (<*>){print "$file\n"};
}
Cheers
Tim