19

Is there a dedicated windows keyboard shortcut for the "Invert Selection" command?

1
  • Not a keyboard shortcut, but you can hold Ctrl and select all files with your mouse. Dec 17, 2019 at 9:40

3 Answers 3

30

Windows 8 + 10:

Alt+H for Home tab in the ribbon, then S and I for Invert Selection.

enter image description here

Windows 7:

Alt+E to open up the Edit menu, then I for Invert Selection.

enter image description here

2
  • I want to know why MS had to make it a 2 character keyboard shortcut? There aren't THAT many options on the home ribbon tab that we can't have "I" or something. Alt-H-I ???
    – Ads
    Jan 24, 2016 at 23:22
  • 1
    Seven years later, this is still inacceptable. Windows 10 gave us 1-click invert Selection, but Windows 11 took it away, then Windows 11 22H2 took it away again, and they still can't give us a keyboard shortcut for it!
    – Medinoc
    May 25 at 17:44
0

An alternative method, which is what I use, is to add a registry entry for your shell right click menu. Therefore, when you select a file or folder(s), all you need to do is right click them and go to select > invert selection.

Add the following to a txt file, and then rename it to .reg

Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\*\shell\Select]
"SubCommands"="Windows.invertselection"
"Position"="middle"

[HKEY_CLASSES_ROOT\LibraryFolder\Background\shell\Select]
"SubCommands"="Windows.invertselection"
"Position"="middle"

[HKEY_CLASSES_ROOT\Directory\shell\Select]
"SubCommands"="Windows.invertselection"
"Position"="middle"

This can expanded upon if you want, by adding more options to the subcommands, but that is entirely up to you.

0

Using AutoHotKey -

#If WinActive("ahk_class CabinetWClass")

^i::                      ; CTRL + i
mousemove 750, 150        ; see Note 1
send {click}              ; click on "see more" option
sleep 500                 ; see Note 2
send {up 3}               ; select "Invert selection" option
; send {enter}            ; see Note 3
return                    ; end

; Note 1: location of "see more" option on screen
; MouseMove - move the mouse cursor to x,y coordinates on 'Screen'
; use Window Spy to determine coordinates for your own screen(s)
; might want to change "CoordMode" if you have problems, visit 
; help page: https://www.autohotkey.com/docs/v1/lib/CoordMode.htm

; Note 2: wait 500ms for window to respond to keys
; wait times (in milliseconds) don't work sometimes,
; try changing them to see what is sufficient for your PC spec/performance.
; Sometimes it doesn't work at all on the 1st try
; (ex: when a new explorer instance is first opened after login/restart)
; but works on subsequent attempts. *shrug* no idea why

; Note 3: uncomment this line after test of previous steps
; or leave it as is if you prefer to do this step manually every time,
; especially if you notice inconsistent selection of options

#If
  • For ribbon UI enabled File Explorer (in older Win 11 and 7/8/8.1/10 systems) -
#If WinActive("ahk_class CabinetWClass")

^i::                      ; CTRL + i
ControlGet, hCtl, Hwnd,, SHELLDLL_DefView1, A
PostMessage, 0x111, 28706, 0,, % "ahk_id " hCtl ; edit, invert selection
return

; Source: https://www.autohotkey.com/boards/viewtopic.php?f=76&t=27564

#If

You must log in to answer this question.

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