Skip to content

Instantly share code, notes, and snippets.

@GollyJer
Last active February 24, 2017 18:22
Show Gist options
  • Save GollyJer/b9a6bf52b0f47141c1cc12f75fc876e4 to your computer and use it in GitHub Desktop.
Save GollyJer/b9a6bf52b0f47141c1cc12f75fc876e4 to your computer and use it in GitHub Desktop.
Use Autohotkey to close a Windows Explorer folder by name.
CloseExplorerFolder(win_title) {
WinGet, vwinID, List, ahk_class CabinetWClass
;MsgBox,0x1000,,there are %vWinID% windows of CabinetWClass open.
Loop, %vWinID% {
x := vWinID%A_Index%
WinGetTitle, wt, ahk_id %x%
if (wt == win_title) {
Winclose, ahk_class CabinetWClass
}
;msgBox,0x1000,, index=%a_Index% of %vWinID%`nwt=%wt%
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment