Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Check for existence of File
Message
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00417498
Message ID:
00417500
Vues:
19
>>>>>>>>>>>>>>>>>>>>>>>>
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
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform