Link to home
Start Free TrialLog in
Avatar of AngelFireMateo
AngelFireMateo

asked on

Delete Files

How can I delete files from delphi in Runtime???

Note: I don't want to use the winexec


regards

Ricardo
Avatar of Epsylon
Epsylon

Use DeleteFile('filename')
uses SysUtils;

....

// erase the file //

 DeleteFile('C:/temporal/file.txt');

ensure that the file exists with the function

 FileExists(filename: string): boolean;

and take care the file permissions if you are under NT.
ASKER CERTIFIED SOLUTION
Avatar of YodaMage
YodaMage

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
Avatar of AngelFireMateo

ASKER

thank's that's what I was looking for