Page 1 of 1

robotask running tasks list and system uptime

Posted: Fri Oct 11, 2019 7:54 pm
by rgonzalez
Is it possible to get a list of robotask current running tasks?

Is it possible to get the computer running uptime or date since last reboot?

Thank you.

Re: robotask running tasks list and system uptime

Posted: Mon Oct 14, 2019 10:44 am
by Oleg
Is it possible to get a list of robotask current running tasks?
Menu Task->Local running tasks
Is it possible to get the computer running uptime or date since last reboot?
Look at my example:

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1604865554
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task720"
Hide=INTEGER|0
ID=INTEGER|-1754372993
LogOnAsUser=INTEGER|1
Name=STRING|"show system uptime"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER
Action3=FOLDER
Action4=FOLDER

[Actions\Action1]
ActionID=STRING|"A_MISC_RUNCONSOLEAPP"
Enabled=INTEGER|-1
Name=STRING|"Run command-line utility: cmd /c systeminfo | find ""System Boot Time"""
Params=FOLDER

[Actions\Action1\Params]
convertansi=STRING|"0"
ifnonzero=STRING|"0"
outputvar=STRING|"out"
params=STRING|"/c systeminfo | find ""System Boot Time"""
program=STRING|"cmd"
saveexitcode=STRING|"0"
saveoutput=STRING|"1"

[Actions\Action2]
ActionID=STRING|"A_REGEXP_MATCH"
Enabled=INTEGER|-1
Name=STRING|"RegExp Match"
Params=FOLDER

[Actions\Action2\Params]
anchored=STRING|"0"
case=STRING|"0"
extended=STRING|"0"
line00000000=STRING|"{out}"
linecount=STRING|"1"
multiline=STRING|"0"
noautocapture=STRING|"0"
pattern=STRING|"(?i)time:\s+([^,]+),\s*(.+)"
savesubexpression=STRING|"1"
singleline=STRING|"0"
subexpressionpos=STRING|"0"
subexpressionvar=STRING|"result"
ungreedy=STRING|"0"
useexternal=STRING|"0"
variable=STRING|"res"

[Actions\Action3]
ActionID=STRING|"A_TIMEDIFFERENCE"
Enabled=INTEGER|-1
Name=STRING|"Time Difference"
Params=FOLDER

[Actions\Action3\Params]
datetime1=STRING|"{result(1)} {result(2)}"
datetime2=STRING|"{DateTime}"
format=STRING|"4"
valuekind=STRING|"0"
varname=STRING|"uptime"

[Actions\Action4]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""{out}"""
Params=FOLDER

[Actions\Action4\Params]
icon=STRING|"1"
msg0=STRING|"{out}"
msg1=STRING|"Up time: {uptime}"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"
Read additional information here

Re: robotask running tasks list and system uptime

Posted: Mon Oct 14, 2019 3:12 pm
by rgonzalez
Thanks, your example works fine, I was trying to do the same thing but I was missing the /c parameter.

And I would like to get a list of robotask running taks and send that list by email, is that possible?

Re: robotask running tasks list and system uptime

Posted: Mon Oct 14, 2019 9:30 pm
by Oleg
And I would like to get a list of robotask running taks and send that list by email, is that possible?
Look at this example

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1448621252
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task631"
Hide=INTEGER|0
ID=INTEGER|-1914646826
LogOnAsUser=INTEGER|1
Name=STRING|"Get running tasks"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
UnicodeFormat=INTEGER|1
WriteGeneralLog=INTEGER|0

[Actions]
Action1=FOLDER
Action2=FOLDER

[Actions\Action1]
ActionID=STRING|"A_SCRIPT_VBSCRIPT"
Enabled=INTEGER|-1
Name=STRING|"VB Script"
Params=FOLDER

[Actions\Action1\Params]
expandvars=STRING|"0"
line00000000=STRING|"cnt = RoboTaskApp.TaskCount"
line00000002=STRING|"txt = """""
line00000003=STRING|"for i=0 to cnt-1 step 1"
line00000004=STRING|"  stat = RoboTaskApp.TaskInfoState(i)"
line00000005=STRING|"  if stat = 3 then 'task is running"
line00000006=STRING|"    nam = RoboTaskApp.TaskInfoName(i)"
line00000007=STRING|"    txt = txt + nam + Chr(13) + chr(10)"
line00000008=STRING|"  end if"
line00000009=STRING|"next"
line0000000B=STRING|"RoboTaskApp.SetUserVariable ""RunningTasks"", txt"
linecount=STRING|"12"
savescript=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Running tasks:"""
Params=FOLDER

[Actions\Action2\Params]
icon=STRING|"1"
msg0=STRING|"Running tasks:"
msg1=STRING|"{RunningTasks}"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"


Re: robotask running tasks list and system uptime

Posted: Tue Oct 15, 2019 5:37 pm
by rgonzalez
works great! excellent service! 5 stars! :lol: