Here is my code:
Here is my output:
I do have permission to access the share drive and I can map the remote share to the D: drive, but it does not seem to be doing it in the PERL script.
Can anyone shed some light please.
Thank you.
Michael Libeson
Code:
use Win32;
use Win32::NetResource qw(:DEFAULT AddConnection CancelConnection);
$| = 1;
%NETRESOURCE = {
'Scope' => "RESOURCE_GLOBALNET",
'Type' => "RESOURCETYPE_ANY",
'DisplayType' => "RESOURCEDISPLAYTYPE_GENERIC",
'Usage' => "RESOURCEUSAGE_CONNECTABLE",
'LocalName' => "D:",
'RemoteName' => "//server/sharename",
'Comment' => '',
'Provider' => ''
};
my $rs = AddConnection(\%NETRESOURCE, 'USERID', 'PASSWORD', 1);
print STDOUT "$rs\n";
print STDOUT `dir D:`;
Here is my output:
Code:
G:\Utils>perl t.pl
0
The system cannot find the path specified.
I do have permission to access the share drive and I can map the remote share to the D: drive, but it does not seem to be doing it in the PERL script.
Can anyone shed some light please.
Thank you.
Michael Libeson