Jump to content

Killing the Script


 Share

Recommended Posts

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

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 :unsure:

Work smarter not harder.My First Posted Script: DataBase

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...