http://www.perlmonks.org?node_id=932308


in reply to Accessing Shared network drive folder

So pls tell me how to include the password in my script

I imagine you would use one of Win32::NetResource/Win32API::Net

Or map network drive with password

  • Comment on Re: Accessing Shared network drive folder

Replies are listed 'Best First'.
Re^2: Accessing Shared network drive folder
by vishalkbhatt (Initiate) on Oct 19, 2011 at 09:05 UTC
    I have to access the drive which is connected thru network (LAN) and not the internet. So how to write the password code for it ??
        Brother I have tried evrything but nothing seems to be working... pls check the code below...
        use Date::Format; use Win32::Capture; $counter = 0 ; while ($counter < 5) { $datetime1 = time2str("-%d-%m-%Y-%k-%M-%S",time); $uname = Win32::LoginName() ; $cname = Win32::NodeName() ; $uname .= $cname; $uname .= $datetime1 ; $image = CaptureScreen(); # Capture Whole screen. $image->SaveToFile("$uname.png"); #$image->SaveToFile("//192.168.0.24/library/vishal/$uname.png"); my $random_number = int(rand(15)); print "\n" , $random_number ; sleep ($random_number ) ; $counter++ ; }
        In the code above the script takes a screen shot at random time. Now I have to upload this image on the linux server's share folder with username and password. I tried Map and Connect both but nothing is working.. The server shared folder path is 192.168.0.24\snapshot.. So pls help me what to do with this ?? thanks..

      I have to access the drive which is connected thru network (LAN) and not the internet. So how to write the password code for it ??

      internet or lan, network is network, so see the links I mentioned, and try some stuff