Run Cmd w/Capture Output - Not working
Posted: Wed Aug 12, 2015 2:25 pm
Hi there, I'm new to the forums, but not new the robotask. I've been using it for some time now, and just recently I've started exploring some more automation revolving around the use of the action "Run command-line utility". I've got several processes that I need to run a command line program and capture the output that's return to do some validation on. The problem is no matter what I do I cannot get the output of the command to return into a variable. To reduce the simplicity of my end goal, and to test if I'm doing something wrong, I tried creating a task to run the windows ping command and capture the results into a variable then show the results. This test also failed. Is anyone else experiencing this issue? Am I doing something wrong? Here's a copy of the task to capture the ping output which is failing.
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
ExternalName=STRING|"Task1"
Hide=INTEGER|0
ID=INTEGER|869195475
LocalVariables=STRING|"RESULTS="
LogOnAsUser=INTEGER|1
Name=STRING|"Ping_Capture"
OnErrorTaskID=INTEGER|-1
Priority=INTEGER|3
RunOnClose=INTEGER|0
RunOnStartup=INTEGER|0
ToLog=INTEGER|3
WriteGeneralLog=INTEGER|0
[Actions]
Action1=FOLDER
Action2=FOLDER
[Actions\Action1]
ActionID=STRING|"A_MISC_RUNCONSOLEAPP"
Enabled=INTEGER|-1
Name=STRING|"Run command-line utility: PING.EXE 4.2.2.2"
Params=FOLDER
[Actions\Action1\Params]
convertansi=STRING|"0"
ifnonzero=STRING|"0"
outputvar=STRING|"{RESULTS}"
params=STRING|"4.2.2.2"
program=STRING|"C:\Windows\System32\PING.EXE"
saveexitcode=STRING|"0"
saveoutput=STRING|"1"
workdir=STRING|"C:\Windows\System32"
[Actions\Action2]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""Results: {RESULTS}"""
Params=FOLDER
[Actions\Action2\Params]
icon=STRING|"1"
msg0=STRING|"Results: {RESULTS}"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"