r/AutoHotkey • u/duscorules • 5d ago
v2 Script Help Why my script is not working ?
I'm using this script to close all Explorer, calculator and command prompt windows , when i press CTRL ALT W , but it only works for Explorer Windows, why ?
^!w:: {
closeAll("ahk_class CabinetWClass")
closeAll("Calculator")
closeAll("ahk_class ConsoleWindowClass")
}
closeAll(winTitle) {
For hWnd in WinGetList(winTitle)
WinClose hWnd
}
3
Upvotes
2
u/Keeyra_ 5d ago
Dunno. This works like a charm, closing all instances of all 3 kinds of windows.
1
u/Mckayla_Deleon50 3d ago
if you go with the WindowsTerminal match, try it og