Gossamer Forum
Home : General : Perl Programming :

Newbie - check for mapped drive

Quote Reply
Newbie - check for mapped drive
Under Windows 2000, I am trying to check for a mapped drive and if not map it. How can I do this?



Thanks for your help.

Last edited by:

Rocky99: Oct 8, 2003, 12:50 PM
Quote Reply
Re: [Rocky99] Newbie - check for mapped drive In reply to
Never mind I found out the easy way.
Quote Reply
Re: [Rocky99] Newbie - check for mapped drive In reply to
Hello Rocky99, Care to help others with your solution ?

and what o/s you were using ?

Thanks cornball
Quote Reply
Re: [cornball] Newbie - check for mapped drive In reply to
Under Windows 2000:

I checked for a mapped drive by using :
if (-d "i:\\test") # Whatever drive letter and folder you have setup
{
printf ("Drive is already mapped.\n\n"); # if folder exists then I assume the drive is mapped
}
else
{
system ("net use i: \\\\testserver\\test"); # I map to the shared folder
}