Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Remote Win32 User

by meetraz (Hermit)
on Nov 14, 2003 at 19:19 UTC ( [id://307162]=note: print w/replies, xml ) Need Help??


in reply to Remote Win32 User

The best way to do this is using Win32::Lanman and connecting to the IPC$ share of the server. The IPC$ share let's you establish a security token with the remote server, without limiting yourself to a particular share. Then you can test for the existence of that file using UNC paths.

An example:

use strict; use Win32::Lanman; my $result = Win32::Lanman::NetUseAdd({ remote => "\\\\yourserver\\ipc\$", password => "yourpass", username => "youruser", domain => "yourdomain", asg_type => &USE_IPC }); if (! $result) { print "Sorry, something went wrong; error: "; print Win32::Lanman::GetLastError(); exit 1; } #test for file existence if (-e "\\\\yourserver\\c\$\\winnt\\system32\\myfile.dll") { print "File exists\n"; } else { print "File does not exist\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://307162]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (6)
As of 2024-03-28 12:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found