I would like to use microsoft visual studio C++ 6.0 to build a execute file to detect whether network drive is connected and ready to used..
can anyone of you teach me how do I do this..??

my situation is I have 2 PC connect using LAN..
PC A create a folder and share out..
PC B map drive so that my software can access content of folder from PC A..
if I do not double click that mapping drive from PC B, my software will fail to access
folder from PC A..
so I do setting at startup there..after I on PC B, will auto connect and open mapping
drive from PC A..
but sometimes, user on PC B before PC A..once again, my software fail to access that
mapping drive which from PC A again..

so I would like to write a program to detect whether mapping drive is ready to use (PC A is on).. and
execute that mapping drive so that my software able to access content of the mapping

Please advise..

Thank you..

6 Years
Discussion Span
Last Post by graphicequalise

For these situations, I use the UNC path (\\servername\sharename) instead of a mapped drive.

This has two big advantages over a mapped drive:
1. It doesn't depend on the user mapping the share to a particular drive letter. (I've had problems in the past where the user had mapped some other share to the drive letter I had planned to use.)
2. It doesn't require that the share be connected before being accessed.

Using the UNC path has made accessing file shares transparent to users of my applications. Hope it will work for you as well.


If you know the drive letter that the shared drive is on, then you could use GetVolumeInformation after checking the drive letter with GetDriveType.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.