2

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?

3 Answers 3

5

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.

3
  • Didn't know that existed :-) combined with shortcuts its just: ALT,E,I,DEL
    – maxfridbe
    Jan 19, 2010 at 21:56
  • +1 for the almost keyboard only method. Rock on!!!
    – pcapademic
    Jan 19, 2010 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.
    – Elle H
    Jan 20, 2010 at 0:13
4

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

3
  • And it works with other windows versions. Jan 19, 2010 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, 2010 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, 2010 at 21:56
1

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)

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .