Need to delete all the files with one extension on a drive in Windows 7

13

5

I have a drive filled with 1000's of files spread across hundreds of folders. I was using a sync program that created many placeholder files throughout the drive. I need to delete all the placeholders but leave the folders and other files intact. I am using Windows 7.

Peter Hoven

Posted 2010-08-20T06:13:04.050

Reputation: 627

Answers

23

I found my own answer at the command line.

del /s *.wlx

where wlx is the file extension in question.

Peter Hoven

Posted 2010-08-20T06:13:04.050

Reputation: 627

You could add the /p switch to prompt on every delete. That said, hitting y enter over and over again gets old fast. – PerryC – 2016-01-16T20:48:51.407

@LarsHoldgaard: The "short name" version of the filename for those ASPX files likely does have an ASP extension. – Ben Voigt – 2016-06-13T14:04:57.323

Powershell: ls *.wlx -Recurse | foreach {rm $_} – Kolob Canyon – 2017-01-19T00:37:28.720

1If I have files called "ASP" and "ASPX" and runs this, it also deletes the ASPX pages... Just saying - its not the "specific" extension – Lars Holdgaard – 2014-02-03T09:21:36.737

5

You can do this using the Windows GUI. Enter "*.wlx" in the search box in explorer. Then after the files have been found, select them all (CTRL-A) and then delete using the delete key or context menu. This also works in older versions of Windows using the separate explorer file search pane and window.

The command line is faster, especially if there are a lot of files. I've just added this answer for the record.

Kevin Brock

Posted 2010-08-20T06:13:04.050

Reputation: 240

I actually tried this first since it is the easiest way to remove these files. The command line method works great for many files but it has the potential delete the wrong files if you are not careful. – Peter Hoven – 2010-08-25T13:39:52.713

0

If you have cygwin -

find . -name '*.wlx' -delete

Aniket Thakur

Posted 2010-08-20T06:13:04.050

Reputation: 597