Hi,

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

Regards,
Rana

Recommended Answers

All 4 Replies

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.

or try

$dir = "x:\\share1\\share2";

if (-d $dir);
{
   print $dir," exists\n";
}
else 
{
   print $dir," not found\n";
}

.

Wow, I completely forgot to check which forum this was in. Thanks for a good Perl answer Jephthah.

yeppp thanks jephthah this really helped me a lott

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.