| View previous topic :: View next topic |
| Author |
Message |
TeeTwo
Joined: 29 Dec 2006 Posts: 123 Location: Australia
|
Posted: Tue May 27, 2008 2:28 am Post subject: Detecting running script |
|
|
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 _________________ (The guy from Oz) |
|
| Back to top |
|
 |
Guest
|
Posted: Tue May 27, 2008 6:02 am Post subject: |
|
|
| use SetTimers instead of loops |
|
| Back to top |
|
 |
Guest
|
Posted: Tue May 27, 2008 6:17 am Post subject: |
|
|
| Code: | Flag = 0
Loop{
If Flag {
;look for the program
}
Else {
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
}
|
|
|
| Back to top |
|
 |
|