How to map network drive

Thread Solved

Join Date: Mar 2009
Posts: 9
Reputation: rana03 is an unknown quantity at this point 
Solved Threads: 0
rana03 rana03 is offline Offline
Newbie Poster

How to map network drive

 
0
  #1
Mar 31st, 2009
Hi I want to map a network drive on Windows platform and i am running my script on Unix machine;
What are the possibilities by which i can map network drive in perl

Please reply

thanks in Advance,
aNa
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: How to map network drive

 
0
  #2
Mar 31st, 2009
Wait What?

You're running a script on *nix, and want that script to map a drive on a windows machine?????
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 9
Reputation: rana03 is an unknown quantity at this point 
Solved Threads: 0
rana03 rana03 is offline Offline
Newbie Poster

Re: How to map network drive

 
0
  #3
Apr 1st, 2009
no i am using script on windows platform only but executing it using cygwin; find below code
#/usr/bin/perl

$map_drive = '/cygdrive/c/windows/system32/net use x: \\share1\share2';
print "\n$map_drive\n ";

system ("$map_drive");

i get below error
/cygdrive/c/windows/system32/net use x: \share1\share2
System error 67 has occurred.

The network name cannot be found.


Please reply
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 2,413
Reputation: Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough Comatose is a jewel in the rough 
Solved Threads: 211
Team Colleague
Comatose's Avatar
Comatose Comatose is offline Offline
Taboo Programmer

Re: How to map network drive

 
0
  #4
Apr 1st, 2009
ah, you are missing a slash of some kind it seems... you are escaping the first backslash with the second. You probably need to add something like this:
  1. $map_drive = '/cygdrive/c/windows/system32/net use x: \\\\share1\\share2';

I dunno if there is a cleaner way to say "hey, don't escape this stuff", but this should work.
Reply With Quote Quick reply to this message  
Join Date: Mar 2009
Posts: 9
Reputation: rana03 is an unknown quantity at this point 
Solved Threads: 0
rana03 rana03 is offline Offline
Newbie Poster

Re: How to map network drive

 
0
  #5
Apr 8th, 2009
thanks for the reply let me try and get back to you
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Perl Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC