I am trying to make a script in my startup folder that checks if scripts are running or not, then starts them if they are not running, I have checked the boards and gotten to the point where the script DOES start the others, but it doesn't check, it just starts everything, prompting me to have to dismiss a bunch of "An older version of this script is already running" messages. Can anyone help me?
Code: Select all
Run, cmd.exe /c "If exist C:\AHK\list.dat del C:\AHK\List.dat",,Hide
Run, cmd.exe /c "dir C:\AHK /B *.AHK > C:\AHK\List.dat",,Hide
SetTitleMatchMode, 2
DetectHiddenWindows, On
Loop, Read, C:\AHK\list.dat
{
Loop, Parse, A_LoopReadLine, %A_Tab%
{
IfWinNotExist, A_LoopField
{
Run, C:\AHK\%A_LoopField%
} else {
Return
}
}
}
Then it reads that list and for each item in the list, check if the script is running, if not, run it, if so, do nothing.
what actually happens is that it does the list correctly, though the list contains the control script despite it not being in that folder, then it doesn't bother checking if a script is running or not, it just runs everything in that list... and the list itself? I'm in version 1.1.33.10 and do not have the ability to update due to network policies at work.