Re: Problem with adding a connection with Win32::NetResource
- From: lontche@xxxxxxxxx (Nash)
- Date: Fri, 28 Dec 2007 06:45:02 -0800 (PST)
On Dec 28, 5:55 am, chas.ow...@xxxxxxxxx (Chas. Owens) wrote:
You are not using the strict pragma (this doesn't effect your current
problem, but it is still a bad idea).
Like I said, I'm new to Perl. By "pragma" I guess you mean syntax?
It also looks (based on the answer to your second question) like X: is
not a valid name. Is it possible that you have already mapped a drive
to X:?
Of course not :) I'm new to Perl, not computers. :)
2. Where can I find the error codes and their meanings?
I would suggest consulting the oracle:http://www.google.com/search?q=smb+error+code+1200
From that search I learned the 1200 means "The specified device name
is invalid."
The unavoidable Google :)) Of course, how stupid of me. But why smb in
the query?
I played with the program a bit more, and first got error code of 66
(the network resource type is not correct) and the modified program
(see below) now gives me code 53 (the network path was not found). I
also tried playing with Scope, Type etc. to no avail.
I still don't know what I'm doing wrong :(
-----------------------------------------------------------------------------------------------------
#!/usr/bin/perl -w
use Win32::NetResource;
$RemoteShare = {
# 'Scope' => RESOURCE_CONNECTED,
# 'Type' => RESOURCETYPE_DISK,
# 'DisplayType' => RESOURCEDISPLAYTYPE_SHARE,
# 'Usage' => RESOURCEUSAGE_CONTAINER,
'LocalName' => "X:",
'RemoteName' => "\\\\Nash",
};
$UserName = "No Name";
$Password = "";
$Connection = 1;
Win32::NetResource::AddConnection($RemoteShare,$Password,$UserName,
$Connection)
or print "unable to add Nash\n";
Win32::NetResource::GetError( $ErrorCode );
print "Error code is $ErrorCode \n";
$ErrorCode = oct $ErrorCode if($ErrorCode =~ /^0/);
print Win32::FormatMessage $ErrorCode;
-------------------------------------------------------------------------------------------------
.
- Follow-Ups:
- Re: Problem with adding a connection with Win32::NetResource
- From: Tom Phoenix
- Re: Problem with adding a connection with Win32::NetResource
- From: Chas. Owens
- Re: Problem with adding a connection with Win32::NetResource
- From: Nash
- Re: Problem with adding a connection with Win32::NetResource
- References:
- Problem with adding a connection with Win32::NetResource
- From: Nash
- Re: Problem with adding a connection with Win32::NetResource
- From: Chas. Owens
- Problem with adding a connection with Win32::NetResource
- Prev by Date: RE: beginners-help@perl.org
- Next by Date: Re: how to accept array elments using loop
- Previous by thread: Re: Problem with adding a connection with Win32::NetResource
- Next by thread: Re: Problem with adding a connection with Win32::NetResource
- Index(es):
Relevant Pages
|