Re: Direcory Exists?

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



I was not able to reproduce your results. I have tried several USB drives
and they all came back as expected. I wonder if your USB device is
encrypted?

If I were to do this in VB 6, I would have used either API or FSO using
samples from Randy Birch's website vbnet.mvps.org, and it occured to me that
I didn't know how to enumerate drives in .Net. You would think that
System.IO would allow you this information, but nay. I found an article
http://www.codeproject.com/csharp/logicaldiskinfo.asp that shows
System.Management is the namespace that you would use. It appears that it
is just a WMI wrapper with late bound objects and structures.






"elziko" <elziko@xxxxxxxxxxx> wrote in message
news:e64IiBL1FHA.2924@xxxxxxxxxxxxxxxxxxxxxxx
>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?
>
> TIA
>


.



Relevant Pages

  • Re: Windows Explorer Not seeing external drive
    ... Both have large HDDs and storage drives. ... USB device a drive letter using the Disk Management utility. ... Where a USB external HDD is involved, ...
    (microsoft.public.windowsxp.help_and_support)
  • Re: Using external USB hard drives with XP Pro
    ... Don't know if any of the USB 2.0 troubleshooting "tips" will help in your ... removing the HDD from its enclosure and installing it as an internal HDD in ... Access Disk Management and see if the USB device is listed. ... highlight the Disk drives listing and click on the Action menu item ...
    (microsoft.public.windowsxp.hardware)
  • Re: Imicro HDD Enclsoure not Working with Seagate/Windows XP
    ... Imicro 3.5" HDD Enclosure ... Windows XP recognizes the enclosure and installs it as a USB Mass ... Access Disk Management and see if the USB device is listed. ... highlight the Disk drives listing and click on the Action menu item ...
    (microsoft.public.windowsxp.hardware)
  • Re: Largest External HDD I Can Use With a Dimension 8200?
    ... Got the problem with the external Maxtor OneTouch II drive resolved. ... I totally uninstalled and reinstalled the Maxtor software, and used a different USB port on the back of my D-8300. ... These problems with ALL THE USB DEVICES started about 6 months ago, and increased with frequency until recently they became intolerable. ... I use the two front USB ports to connect my PNY Flash Drives, and get errors when plugging in to forward connector, but not the back one. ...
    (alt.sys.pc-clone.dell)
  • Re: Installing Fedora without a CDROM: my HOWTO
    ... Here is my HOWTO on installing Linux from a USB drive, ... disk or USB key rather than a CDROM boot disk. ... Put auxillary files (special drivers, post setup install config, ... This way I can mount any number of hard drives in the ...
    (Fedora)