There is something -at first sight very basic- I would like to do: when I start a vbs script, I want to display a warning if this same vbs is already running (to avoid file in use problems etc).
Two options I see:
work with a temporary file created at the start of the vbs and removed at the end of it. Disadvantage: if the script ever crashes, the temporary file will not be removed.
Second option I see is to work with wmi Win32_process: collect all processes on the pc and use string manipulation to see if wscript/cscript + name-of-script is found more then once in it. Seems doable - but I wonder if there is no more streightforward solution ?
Greetz
Two options I see:
work with a temporary file created at the start of the vbs and removed at the end of it. Disadvantage: if the script ever crashes, the temporary file will not be removed.
Second option I see is to work with wmi Win32_process: collect all processes on the pc and use string manipulation to see if wscript/cscript + name-of-script is found more then once in it. Seems doable - but I wonder if there is no more streightforward solution ?
Greetz