
Pyrofreak
New User
Aug 26, 2011, 5:02 AM
Post #4 of 4
(2746 views)
|
Re: [Pyrofreak] Connection to a Networkdrive in a different Domain
[In reply to]
|
Can't Post
|
|
I figured out a way to do this with Win32::NetResource
use Win32::NetResource; my $RemoteName = "\\\\123.456.789.10\\folder"; my $RemoteShare = { 'Scope' => RESOURCE_CONNECTED, 'Type'=> RESOURCETYPE_DISK, 'DisplayType' => RESOURCEDISPLAYTYPE_GENERIC, 'Usage' => RESOURCEUSAGE_CONNECTABLE, 'RemoteName' => $RemoteName, }; my $UserName = "test2\\testuser"; my $Password = "password"; my $Connection = 0; Win32::NetResource::AddConnection($RemoteShare,$Password,$UserName,$Connection) or print "unable to connect to the network\n"; open(FILE, "$RemoteName\\test.txt"); Maybe this will help someone that will have the same Problem at some point ^^
(This post was edited by Pyrofreak on Aug 26, 2011, 5:05 AM)
|