I want to close all folders that include this directory in it's link C:\Users\******\AppData\ ...
How can I do that? I tried to research and find solution, but I couldn't.
How to close folder? Topic is solved
How to close folder?
“You see things; you say, 'Why?' But I dream things that never were; and I say 'Why not?”
― George Bernard Shaw
― George Bernard Shaw
Re: How to close folder? Topic is solved
Hmm... I'm not sure what you mean. This closes windows but not folders. Folders don't really open or close; they are just there.
Code: Select all
WinGet, win, List, ahk_class CabinetWClass ahk_exe explorer.exe
Loop, %win% {
hWnd := win%A_Index%
For oWin in ComObjCreate("Shell.Application").Windows()
If (oWin.HWND = hWnd && oWin.Document.Folder.Self.Path ~= "i)c:\\Users\\.+\\AppData\\")
WinClose, ahk_id %hWnd%
}