Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

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
[535 byte] By [jobartley515] at [2007-11-11 7:00:32]
# 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 :)
Code_Writer at 2007-11-11 17:27:35 >
# 2 Re: How to inquire that a folder is in a certain place
Thanks, I can't believe it was that easy...! :)
jobartley515 at 2007-11-11 17:28:34 >