On Dec 28, 5:55 am, [EMAIL PROTECTED] (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;
-------------------------------------------------------------------------------------------------


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to