I have a same script in different folders, when i run scripts one by one, they all started running, even though they have same name.
i think it's because of the nature of #SingleInstance force, It cant close the previous script with the same name if it's in the different folder.
I try to do that with the below script i found but it's not working can anyone tell me what i'm doing wrong here.
WinGet, vWinList, List, \Test.ahk ahk_class AutoHotkey
Loop, % vWinList
hWnd := vWinList%A_Index%
;WinGetTitle, vWinTitle, % "ahk_id " hWnd
;WinGetClass, vWinClass, % "ahk_id " hWnd
;WinGet, vPID, PID, % "ahk_id " hWnd
if !(hWnd = A_ScriptHwnd)
WinClose, % "ahk_id " hWnd