Home » Questions » Computers [ Ask a new question ]

How to delete all files but one in a Windows folder

How to delete all files but one in a Windows folder

In Windows 7 is there a way to select a file and delete all but that file in a folder? Or is there an app for that behavior already in existence? Maybe a right click menu?

Asked by: Guest | Views: 132
Total answers/comments: 2
bert [Entry]

Select the file you want to keep and then select Edit > Invert Selection. Then either hit Del or Shift+Del to delete them, or right click over the selected items.
bert [Entry]

"For a mouse-free solution, with file selected (arrow keys?), Ctrl-A, Ctrl+Space.

You could script this with Autohotkey:

#SingleInstance Force

!d::
send ^a
send ^{Space}
send {Delete}
return

Select file, Alt+D.

To select a file in a folder, you can type the filename whilst the folder has focus. Windows will select the file that matches what you have typed up to that point. Then Ctrl+A, Ctrl+Space, Delete. (Or use above script)"