From: Paul Kraus <[EMAIL PROTECTED]>
> I have a perl script that uses file::copy to copy files from a server
> to the local machine. It does alot more then that but is pretty much
> the jist of what is taking place. Currently i have to have the local
> machine first establish the connection so that authentication takes
> place.
> 
> start -> run
> \\server\path\share
> 
> Auth Window pops up, i enter the authentication.
> Now i can run my script.
> 
> I want the script to handle the connection.

use Win32::FileOp qw(Map);

Map '' => '\\\\server\share', {user => ..., passwd => ...}
        or die "Can't connect to \\\\server\\share: $^E\n";

copy( $from => $to);

You might also use the Win32::FileOp::Copy()/CopyConfirm()/CopyEx() 
if you wanted confirmation and progress dialogs and such stuff.

HTH, Jenda
===== [EMAIL PROTECTED] === http://Jenda.Krynicky.cz =====
When it comes to wine, women and song, wizards are allowed 
to get drunk and croon as much as they like.
        -- Terry Pratchett in Sourcery


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


Reply via email to