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 certain file extensions

Status
Not open for further replies.

Vec

IS-IT--Management
Jan 29, 2002
418
US
How do I create a command that will look at drive C: and delete all files with a specific extension, like if I wanted to delete all files with the extension .tmp regardless of the file name, in other words, like a wild card. Delete *.tmp

-
radium.gif

Looking Toward The Future
 
Hi,

Use the filesystem object to loop all directories on the drive recursively. loop through all files in each directory and check the extension. The proccess will take a while.

To get an idea of how to loop all the directories, see faq222-867 (or seach the web I'm sure you'll find a snipplet that does exactly that).

Sunaj
'The gap between theory and practice is not as wide in theory as it is in practice'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top