Ace08 Posted April 18, 2011 Share Posted April 18, 2011 Hi guys here is my problem I made a script that opens a file edit its contents and then save the file to another folder, but the thing is the script will be placed thru scheduled tasks which will run every 1 minute. what i want to do is if the script sees itself still running it will let the first run script to continue while the other close itself. Its kindda difficult to explain so i'll just give an example. Supposed the script is named Edit.exe it will run by scheduled task every 1 minute, lets say Edit.exe runs at 8:00am and for some reason the script isn't finished executing by 8:01am but the sceduled task will then again run Edit.exe so now i have 2 Edit.exe running. Question is if the script is still running then run again for the 2nd time will it know that so it can close itself(2nd script)and let the 1st run script to finish executing? i've tried processexists but running this script once already tells that its running. If ProcessExists("Edit.exe") Then MsgBox(0, "Debug", "Running.") Else MsgBox(0, "Debug", "Not Running.") EndIf Work smarter not harder.My First Posted Script: DataBase Link to comment Share on other sites More sharing options...
notta Posted April 18, 2011 Share Posted April 18, 2011 How about using a launcher that calls edit.exe? ;launcher.exe If ProcessExists("Edit.exe") Then Exit Else ;run edit.exe EndIf Link to comment Share on other sites More sharing options...
wakillon Posted April 18, 2011 Share Posted April 18, 2011 If your script have the same name , it will always return that process exists !Use Pid comparison for know if there are another process or _Singleton function ! AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Link to comment Share on other sites More sharing options...
Ace08 Posted April 18, 2011 Author Share Posted April 18, 2011 Thanks notta but i already have a launcher exe as an alternative if what i am thinking is kindda impossible. @wakillon Thanks for the idea will try this although im not realy familliar with PID functions Work smarter not harder.My First Posted Script: DataBase Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now