How to check whether network drive is mapped or not

Please support our Perl advertiser: Programming Forums - DaniWeb Sister Site
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 check whether network drive is mapped or not

 
0
  #1
Apr 10th, 2009
Hi,

Can somebody let me know how to check whether particular network drive is mapped or not e.g x:\\share1\share2?

Regards,
Rana
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 568
Reputation: OlyComputers will become famous soon enough OlyComputers will become famous soon enough 
Solved Threads: 34
OlyComputers OlyComputers is offline Offline
Posting Pro

Re: How to check whether network drive is mapped or not

 
0
  #2
Apr 11th, 2009
Are you asking how to check that it's mounted from the system that's accessing it? This is pretty simple and just a matter of trying to access the drive. If you're looking for a simple command line to do it I suppose just running CD X (X being the letter assigned to the newtork drive) would do the job, since you should get an error if the drive isn't accessible.
-This post is provided without warranty, emotion, or a conscience. Hope it helps-
*I'm an egomaniac: I love reputation points*
Reply With Quote Quick reply to this message  
Join Date: Feb 2008
Posts: 1,621
Reputation: jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of jephthah has much to be proud of 
Solved Threads: 121
jephthah's Avatar
jephthah jephthah is offline Offline
Posting Virtuoso

Re: How to check whether network drive is mapped or not

 
0
  #3
Apr 20th, 2009
or try
  1. $dir = "x:\\share1\\share2";
  2.  
  3. if (-d $dir);
  4. {
  5. print $dir," exists\n";
  6. }
  7. else
  8. {
  9. print $dir," not found\n";
  10. }

.
Last edited by jephthah; Apr 20th, 2009 at 3:08 pm.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 568
Reputation: OlyComputers will become famous soon enough OlyComputers will become famous soon enough 
Solved Threads: 34
OlyComputers OlyComputers is offline Offline
Posting Pro

Re: How to check whether network drive is mapped or not

 
0
  #4
Apr 20th, 2009
Wow, I completely forgot to check which forum this was in. Thanks for a good Perl answer Jephthah.
-This post is provided without warranty, emotion, or a conscience. Hope it helps-
*I'm an egomaniac: I love reputation points*
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 check whether network drive is mapped or not

 
0
  #5
Apr 28th, 2009
yeppp thanks jephthah this really helped me a lott
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