I am soliciting the assistance of a forum member in finding or creating a VB script that launches an application if (1) a specified process is not already running and (2) the PC is ‘idle’ (i.e., CPU usage is below a specified threshold). The script would loop until either the CPU usage condition is met or a maximum duration has been exceeded.
A conceptual outline of the script logic would roughly be as follows.
BEGIN
LET APP=”C:\Program Files\Application.exe”
LET PROCESS=”ProcessX.exe”
LET CPU_USAGE=50 {% of time the processor is running}
LET PAUSE_TIME=5 {seconds}
LET MAX_TIME=120 {seconds}
IF (‘PROCESS’ is already running) THEN
EXIT
ELSE
DO
IF (CPU usage <= ‘CPU_USAGE’) THEN
IF (‘PROCESS’ is already running) THEN
EXIT
ELSE
Launch ‘APP’
EXIT
ELSE
Pause for ‘PAUSE_TIME’
WHILE (total run time of script <= ‘MAX_TIME’)
EXIT
END
All recommendations and assistance are greatly appreciated!
A conceptual outline of the script logic would roughly be as follows.
BEGIN
LET APP=”C:\Program Files\Application.exe”
LET PROCESS=”ProcessX.exe”
LET CPU_USAGE=50 {% of time the processor is running}
LET PAUSE_TIME=5 {seconds}
LET MAX_TIME=120 {seconds}
IF (‘PROCESS’ is already running) THEN
EXIT
ELSE
DO
IF (CPU usage <= ‘CPU_USAGE’) THEN
IF (‘PROCESS’ is already running) THEN
EXIT
ELSE
Launch ‘APP’
EXIT
ELSE
Pause for ‘PAUSE_TIME’
WHILE (total run time of script <= ‘MAX_TIME’)
EXIT
END
All recommendations and assistance are greatly appreciated!