Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MAP network drive 1

Status
Not open for further replies.

mikeprestim

Programmer
Mar 1, 2001
21
GB
Is there a perl module or is there a way to map a network share using perl ?.

even better also allowing connection with a different user name. I want to put this on a win98 setup.

I do not want to do a system call to net

Thanks

Mike McMahon
 
In the current version of Perl for Win32, and the current version of the standard distribution, opendir fails on UNC paths. You can work around this by mapping a drive to the UNC share before using directory handles, and then using the drive letter as the path instead of the UNC path. You can do this with the Win32::NetResource module extension (see the AddConnection function) or with the Windows NT net use command

The Win32::NetResource module allows you to manage shared resources on a network, such as printers, disks, etc.

AddConnection (\%netresource, password, username, connection)
Connects to the resource described in %netresource, with the password and username of the user. The connection flag indicates whether the connection should be remembered for the user for all logins.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top