Ensuring program is running
Posted: Sun Jan 26, 2025 1:17 pm
Hello everyone,
I would like to check cyclically whether a certain program "A" is running. If it is not running, a certain program "B" should be closed if it is running and "A" should be started automatically. My code does not seem to work:
I would like to check cyclically whether a certain program "A" is running. If it is not running, a certain program "B" should be closed if it is running and "A" should be started automatically. My code does not seem to work:
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|0
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
Events=FOLDER
ExternalName=STRING|"Task1"
Hide=INTEGER|0
ID=INTEGER|-1927680902
LogOnAsUser=INTEGER|1
Name=STRING|"Ensure ""Automatic Email Processor"" is running"
OnErrorTaskID=INTEGER|0
Priority=INTEGER|3
RestrictRESTAPIAccess=INTEGER|0
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
StepPause=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER
Action5=FOLDER
Action6=FOLDER
[Actions\Action1]
ActionID=STRING|"A_MISC_WAITPROCESSSTART"
Enabled=INTEGER|-1
Name=STRING|"Wait for process ""C:\Program Files (x86)\Automatic Email Processor\AutomaticEmailProcessor.exe"" start (1 sec)"
Params=FOLDER
[Actions\Action1\Params]
_rt_variables_produced=STRING|"AEP"
infinity=STRING|"0"
process=STRING|"C:\Program Files (x86)\Automatic Email Processor\AutomaticEmailProcessor.exe"
timeout=STRING|"1"
waitresult=STRING|"1"
waitresultvar=STRING|"AEP"
[Actions\Action2]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action2\Params]
case=STRING|"0"
connection=STRING|"0"
count=STRING|"1"
operator=STRING|"1"
type=STRING|"3"
value1=STRING|"{AEP}"
value2=STRING|"0"
[Actions\Action3]
ActionID=STRING|"A_MISC_KILLAPP"
Enabled=INTEGER|-1
Name=STRING|"Terminate process ""C:\Program Files (x86)\Automatic Email Processor\AEPProcessor.exe"""
Params=FOLDER
[Actions\Action3\Params]
more=STRING|"2"
process=STRING|"C:\Program Files (x86)\Automatic Email Processor\AEPProcessor.exe"
[Actions\Action4]
ActionID=STRING|"A_GENERAL_PAUSE"
Enabled=INTEGER|-1
Name=STRING|"Delay 10 sec"
Params=FOLDER
[Actions\Action4\Params]
delay=STRING|"10"
dimension=STRING|"1"
[Actions\Action5]
ActionID=STRING|"A_GENERAL_RUN_PROG"
Enabled=INTEGER|-1
Name=STRING|"Run ""AutomaticEmailProcessor.exe """
Params=FOLDER
[Actions\Action5\Params]
ifnonzero=STRING|"0"
program=STRING|"C:\Program Files (x86)\Automatic Email Processor\AutomaticEmailProcessor.exe"
runas=STRING|"2"
wait=STRING|"0"
[Actions\Action6]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
[Events]
Event1=FOLDER
[Events\Event1]
Enabled=INTEGER|-1
EventID=STRING|"E_GENERAL_CYCLIC"
Name=STRING|"Cyclic (every 600 sec)"
Params=FOLDER
UniqueID=INTEGER|1994471606
[Events\Event1\Params]
interval=STRING|"600"
notsatrtatactivation=STRING|"0"