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?

link|improve this question

80% accept rate
feedback

3 Answers

up vote 2 down vote accepted

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.

link|improve this answer
Didn't know that existed :-) combined with shortcuts its just: ALT,E,I,DEL – maxfridbe Jan 19 '10 at 21:56
+1 for the almost keyboard only method. Rock on!!! – pcapademic Jan 19 '10 at 23:24
@EricJLN While a little clumsy, you can do keyboard-only by pressing CTRL+A to select all, then using the keys to navigate to the file you want to keep, and pressing CTRL+SPACE. – Zurahn Jan 20 '10 at 0:13
feedback

Press CTRL+A to choose all items, then hold CTRL and left-click to deselect individual files.

link|improve this answer
And it works with other windows versions. – Artur Carvalho Jan 19 '10 at 21:48
I knew that, I was hoping for a 1 click solution, or 1 keyboard shortcut, every second on the computer helps. This is actually how I do it now. – maxfridbe Jan 19 '10 at 21:50
2  
This is the best answer. Would you really want a "delete all but this" entry in the context menu? How often are you really performing this action? – RJFalconer Jan 19 '10 at 21:56
feedback

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)

link|improve this answer
I like it. Granted, it will only work where one has made the script. – pcapademic Jan 19 '10 at 23:25
Ty. "Ctrl+A, Ctrl+Space, Delete" is generic. Script just combines that to one key combination – RJFalconer Jan 20 '10 at 0:10
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.