I have a simple script that is initiates in the startup folder. It detects if there is a program present when a Usb memory device is inserted.
It then runs that program and exits the loop.
I wish to create another loop that keeps looking at the loaded script and if not present jumps into the first loop waiting for insertion again
Code:
Flag = 0
Loop{
If Fileexist("e:\Myprog.exe"){
run,e:\Myprog.exe
Flag = 1
}
If Fileexist("f:\Myprog.exe"){
run,f:\Myprog.exe
Flag = 1
}
If Fileexist("g:\Myprog.exe"){
run,g:\Myprog.exe
Flag = 1
}
If Flag = 1
Break
sleep, 2000
Continue
}
This works fine but I need assistance to detect the running script
Terry