Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Check for existence of File
Message
General information
Forum:
Visual Basic
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00417498
Message ID:
00417500
Views:
17
>>>>>>>>>>>>>>>>>>>>>>>>
I would like to check whether a particular file exist in
the hard disk. How should the syntax be like? Pls advise, thanks.

Eg: Check whether the "autoexec.bat" exist in the C:\ root directory.
>>>>>>>>>>>>>>>>>>>>>>>>>

Public Function FileExists(strFileName as string) as boolean
if dir(strFileName) = "" then
FileExists = False
else
FileExists = True
end if
end function

' ... Then, check if FileExists("C:\autoexec.bat")
The whole problem with the world is that fools and fanatics are always so certain of themselves, but wiser people so full of doubts. - Bertrand Russell
Previous
Reply
Map
View

Click here to load this message in the networking platform