How to inquire that a folder is in a certain place
I want to be able to inquire if the specified folder is in the specified place...
For example, when I want to find out if a certain file is where it should be I use:
X% = Len(Dir$("C:\WINDOWS\example.txt"))
Then I go along on my way.
I would like to know how to do this with a folder,
I've tried this>>>
X% = Len(Dir$("C:\WINDOWS"))
However it always comes up X% = 0 even when its there.
Any ideas or comments would be great
Thanks Jobartley515
# 1 Re: How to inquire that a folder is in a certain place
I think these will work for both folders and files:
Folders: DirExists = (Dir("C:\WINDOWS\") <> "")
If DirExists = False Then
'Dir Dose Not Exists
Else
'Dir Exists
End If
Files: FileExists = (Dir("C:\WINDOWS\explorer.exe") <> "")
If FileExists = False Then
'File Dose Not Exists
Else
'File Exists
End If
Hope This Works For You :)