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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete all files from a directory

Status
Not open for further replies.

acorbally

Programmer
Jan 9, 2001
65
US
I need to delete all the files from a directory and I find that unless I know the entire name, I am unable to delet or erase by using wild card characters. Any thoughts on how I can delete all files containing FTSC in the beginning of their name? Or how to format the A drive would also work. But I would prefer a fix for deleting all files having FSTC in their name.
 

What command do you use to delete the files?
Can you show your code?

Also, take a look at ADIR() function - it may help you.

 
Stella's suggestion of using FPW's ADIR() function is the best approach.

In that way you can get the full filenames for all of the files within the directory which match your desired criteria (if necessary see FPW Help on using the function).

Then merely use FOR/ENDFOR to sequence through all of the file names and ERASE them.

Good Luck,


JRB-Bldr
VisionQuest Consulting
Business Analyst & CIO Consulting Services
CIOServices@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top