Problem with adding a connection with Win32::NetResource
- From: lontche@xxxxxxxxx (Nash)
- Date: Thu, 27 Dec 2007 12:15:12 -0800 (PST)
Hi all,
I'm new to Perl and I'm trying to use it to connect to a shared disc
through a home network. This is what I've tried:
--------------------------------------------------------------------------------------------------------------------
#!/usr/bin/perl -w
use Win32::NetResource;
$RemoteShare = {
'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";
-----------------------------------------------------------------------------------------------------------------------
The program actually works if I omit the 'LocalName' definition in
line 4, i.e. it makes the connection. However, since I don't have a
local name I can't subseqently cancel the connection, and I'd like to
be able to do that.
With the local name definition, the program doesn't make the
connection, reporting an error code of 1200.
So:
1. What am I doing wrong?
2. Where can I find the error codes and their meanings?
TIA,
Nash
.
- Follow-Ups:
- Re: Problem with adding a connection with Win32::NetResource
- From: Chas. Owens
- Re: Problem with adding a connection with Win32::NetResource
- Prev by Date: Re: FTP file handle question
- Next by Date: Re: replace chars
- Previous by thread: FTP file handle question
- Next by thread: Re: Problem with adding a connection with Win32::NetResource
- Index(es):
Relevant Pages
|