>I have a program that will ask the user for a directory name. I need to be able to verify whether or not that directory exists.
>
>Can anyone give me some example code for checking for the existence of a directory contained in a string?
>
>Thanks in advance,
>
>Ben Holton
Hi Chet,
Another approach to your problem would be display BrowseForFolder window. In this case you don't have to validate what users typed.
Anyway, if you want to verify whether or not a directory exists, use code below:
Dim FSO as Object
Set FSO = Wscript.CreateObject("Scripting.FileSystemObject")
if not FSO.FolderExists(strFolder) then
MsgBox "Folder " & strFolder & " doesn't exist."
end if
Set FSO = Nothing
Just my 2 cents, Igor
Igor Gelin
Database Developer