Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Directory.Exists - Not working?

Status
Not open for further replies.

elziko

Programmer
Nov 7, 2000
486
0
0
GB
I want to use the Directory.Exists method to see if a directory exists. But
it doesn't seem to work for the root of a removable (USB) drive.

I plug in my drive and it gets allocated a letter ("F:"). I then confirm
that I can view the drive in Windows Explorer but:

Directory.Exists("F:\")


returns False!

Directory.Exists("C:\")


returns True as expected!

Is this by design or a bug? Is there an alternative that will work for all
paths including on removable drives?

Thanks,

elziko
 
Have you tried using the logical drive list?
Code:
Dim sLog As String() = Directory.GetLogicalDrives



Sweep
...if it works dont f*** with it
curse.gif
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top