Thanks to Joe Sova.
Do not use Dir to check for the existence of a folder, not one called \Con anyway. If you pass a string to Dir with \Con in it for the test, it will return it as true, even if the folder, "\Con" does not exist! I guess this goes back to a DOS problem from long ago where files could not be deleted if they had names of Dos devices.such as SCRN, CON and PRN.
Ex. ? dir$("C:\Con") = Con -Always!
This is a VB6 thing, not sure about .NET
Try using the following code to search for "C:\CON" and "C:\Temp\CON".
MsgBox Dir$("C:\CON")
MsgBox Dir$("C:\Temp\CON")
|