Link to home
Start Free TrialLog in
Avatar of neopolis
neopolis

asked on

Check if file Exist only

Hello when i start my application the first thing i want it to do automatically is check to see if a file exist in a dir.

the file is called   Check.dat its in C:\

now if Check.dat exist then do nothing

but if Check.dat is not exist then the Appliacation Exits

thanks in advance  give to me full example because i am new and learning thank you
Avatar of PeterLarsen
PeterLarsen

Im not sure this is what you want, but this should do it :

if FileExists('c:\Check.dat') then do something...

Regards
Peter
Avatar of neopolis

ASKER

Hi Peter

what i want is some code

that checks for the Check.dat file in windows dir
if the file is there then the application stay running

if the file is not there then the application Exits

thanks
ASKER CERTIFIED SOLUTION
Avatar of VSF
VSF
Flag of Brazil image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Yo VSF,

I think what Neopolis want is to search throught the windows directory.
To do that you must open the registry first to find the path :-(

/Peter :-)
Thank you Peter
PeterLarsen:
Noops... I think that was what he needed!

Neopolis:
I'm glad to help!

Post your questions if you have any problems... We'll allways be here to try to solve then!

VSF
UIN:14016999

Please show your support by entering my sites!
www.victory.hpg.com.br
www.enge.cjb.net
i went to your site cool i bookmarked so i will be back
*smiles*