I'm hoping someone can help me with Win32::NetResouce::AddConnection function. Every
time I run the code below I get the following error. I'm trying to connect to a
printer. The problem lies in the %NetResouce hash. Thanks in advance...
Argument "RESOURCE_GLOBALNET" isn't numeric in pack at netresource.pm line 274
Argument "RESOURCETYPE_PRINT" isn't numeric in pack at netresource.pm line 274
Argument "RESOURCEDISPLAYTYPE_GENERIC" isn't numeric in pack at netresource.pm line 274
Argument "RESOURCEUSAGE_CONNECTABLE" isn't numeric in pack at netresource.pm line 274
Here's the code:
##########################
use win32::NetResource;
%NetResource = (
'Scope' => RESOURCE_GLOBALNET,
'Type' => RESOURCETYPE_PRINT,
'DisplayType' => RESOURCEDISPLAYTYPE_GENERIC,
'Usage' => RESOURCEUSAGE_CONNECTABLE,
'RemoteName' =>"\\\\sea_sh01\\3-ops-b",
'Provider' =>"Microsoft Windows Network"
);
$user = " ";
$password = " ";
if (Win32::NetResource::AddConnection(\%NetResource, $password, $user, 1))
{
print "successfull\n";
}
else{
print "ERRG\n";
}
#####################
Liam Coen
Helpdesk
--------------------------------------
Getty Images Corp.
701 N. 34th Street Suite 400
Seattle, Washington 98103
Phone: 206.268.1335
_______________________________________________
Perl-Win32-Admin mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-admin