Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

delete files

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
Can someone please tell me how to delete files from a directory? I create some Word docs and then print them, but then want them to go away! Thanks! Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
Nice and simple.

DeleteFile('C:\Temp\Tempfile.txt');

if there is no file though an error will crop up so you can do one of two things.

1). Place in a try except loop.
2). if FileExists('C:\Temp\TempFile.txt') then DeleteFile('C:\Temp\TempFile.txt');

This should work! Arte Et Labore
 
Thanks! I'll give it a try! Leslie
landrews@metrocourt.state.nm.us

SELECT * FROM USERS WHERE CLUE > 0
No Rows Returned
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top