Sure,

This will map a network drive, sleep 10, and then disconnect the drive.


I hope this joker is thread safe...  :)  I have to map several network
drives at one time, and then disconnect them when Im done copying and
receiving.  

#!c:\perl\bin\perl.exe
use strict;
use Win32::OLE;

my $LocalName = 'Z:';
my $RemoteName = "\\\\server\\root";
my $UpdateProfile = 0;
my $User = 'username';
my $Password = 'password';
my $Force = 1;

my $objnet=Win32::OLE->CreateObject("Wscript.Network");

$objnet->MapNetworkDrive($LocalName, $RemoteName, $UpdateProfile, $User,
$Password);

print Win32::OLE->LastError();

sleep (10);

$objnet->RemoveNetworkDrive($LocalName, $Force, $UpdateProfile)



-----Original Message-----
From: Bullock, Howard A. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, April 18, 2006 2:04 PM
To: Daniel Rychlik; [email protected]
Subject: RE: Win32-OLE Network

Do you mind sharing the solution?


_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to