Open Console Session Action Issue

Discuss RoboTask here
Post Reply
Zac
Posts: 18
Joined: Wed Feb 22, 2023 5:14 pm

Open Console Session Action Issue

Post by Zac »

Hello,

I've just recently this week on 5/29 started having an issue with this action for opening the console session so I could have cmd.exe open in order to write commands to the console to send files to a location we have online for a website. For some reason, it keeps giving the error below in the second picture. The first picture is the only settings I have on the Open Console Session. Also like I mentioned before, this only started happening recently starting yesterday and before now for the past year we haven't had this issue with the task so I'm wondering if something changed or if I need to add anything in order for this to work for the next action which is Write to Console Session to work! Thank you!
Open console Session Action Settings
Open console Session Action Settings
Capture1.PNG (23.84 KiB) Viewed 5178 times
Error Log
Error Log
Capture2.PNG (29.9 KiB) Viewed 5178 times
Oleg
Site Admin
Posts: 3011
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Open Console Session Action Issue

Post by Oleg »

Hm-m... It works without problem
look at my example below
Save the text of the task to a file and use menu Task->Import to import the task into RoboTask.
Also you can simply copy task text and paste it into the task list.

Code: Select all

;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
 
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|-1
CatID=INTEGER|1040932817
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task1418"
Hide=INTEGER|0
ID=INTEGER|548263718
LogOnAsUser=INTEGER|1
Name=STRING|"do DIR command"
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
Action5=FOLDER
Action6=FOLDER

[Actions\Action1]
ActionID=STRING|"A_CONSOLEAPP_OPEN"
Enabled=INTEGER|-1
Name=STRING|"Open console application cmd.exe"
Params=FOLDER

[Actions\Action1\Params]
application=STRING|"cmd.exe"
clearenv=STRING|"0"
covertansi=STRING|"1"
paramlinecnt=STRING|"0"
tolog=STRING|"1"
variablescnt=STRING|"0"

[Actions\Action2]
ActionID=STRING|"A_CONSOLEAPP_WAIT"
Enabled=INTEGER|-1
Name=STRING|"Wait for Text"
Params=FOLDER

[Actions\Action2\Params]
expr00000000=STRING|">$"
linecnt=STRING|"1"

[Actions\Action3]
ActionID=STRING|"A_CONSOLEAPP_WRITE"
Enabled=INTEGER|-1
Name=STRING|"Write To Console Session (dir c:\)"
Params=FOLDER

[Actions\Action3\Params]
command=STRING|"dir c:\"

[Actions\Action4]
ActionID=STRING|"A_CONSOLEAPP_WAIT"
Enabled=INTEGER|-1
Name=STRING|"Wait for Text"
Params=FOLDER

[Actions\Action4\Params]
expr00000000=STRING|">$"
linecnt=STRING|"1"

[Actions\Action5]
ActionID=STRING|"A_CONSOLEAPP_READ"
Enabled=INTEGER|-1
Name=STRING|"Read from Console Session"
Params=FOLDER

[Actions\Action5\Params]
clear=STRING|"0"
variable=STRING|"out"

[Actions\Action6]
ActionID=STRING|"A_DIALOG_SHOWTEXT"
Enabled=INTEGER|-1
Name=STRING|"Show Text"
Params=FOLDER

[Actions\Action6\Params]
autoclose=STRING|"0"
fromfile=STRING|"1"
line00000000=STRING|"{Out}"
linecount=STRING|"1"
timeout=STRING|"10"
I'm afraid that you have some system problem
Oleg Yershov
Zac
Posts: 18
Joined: Wed Feb 22, 2023 5:14 pm

Re: Open Console Session Action Issue

Post by Zac »

I was finally able to figure out the issue I was having. I did a temporary fix until now for fixing the issue by creating steps that would manually go through the step of opening cmd.exe and typing in the command I want and setting a timer to close the console session to move onto the next task. I figured out the reason why now that the task wasn't working and it wasn't a system problem. Turns out it was something super simple that I completely missed which was in the "Open console application" action in the "System Environment Variables", I needed to click "Copy from system environment" so that the "Open console session" could read the environment variables to open Command Prompt. I didn't think I needed to do that and that Robotask could just read it but it couldn't until I did that and it's working as it should now. Figured I'd post the solution here if anyone ends up making this simple mistake like I did.
Post Reply