Page 1 of 1
Password Variable Not Working in “Pack Files” Action
Posted: Tue Mar 17, 2026 5:57 am
by kentledgetrembling
Hi everyone,
I’m new here and I’ve run into a strange issue with the “Pack Files” action. When I try to use a password stored in a variable, Robotask uses the variable name itself as the password instead of the actual value inside the variable.
Example:
Variable name: {PSWD_LOC}
Variable value: MyPassword
Password applied during packing: {PSWD_LOC} instead of MyPassword
I’ve tried different formats (with/without braces, local/global variables, etc.) but nothing seems to change the behavior. I’m not sure if this is a bug or if I’m missing something.
Has anyone else experienced this or found a workaround?
Thanks!
Re: Password Variable Not Working in “Pack Files” Action
Posted: Sun Mar 22, 2026 7:09 pm
by Oleg
It works. Test my example
Code: Select all
;*****************************
;* RoboTask Task file
;* Do not edit in text editor!
;*****************************
[Root]
ActionAfterRun=INTEGER|0
Actions=FOLDER
Automat=INTEGER|0
CatID=INTEGER|307868550
Comment=STRINGLIST
ContinueOnError=INTEGER|0
DisableOnError=INTEGER|0
DoNotStopWhenShutdown=INTEGER|0
ExternalName=STRING|"Task1620"
Hide=INTEGER|0
ID=INTEGER|1182452978
LogOnAsUser=INTEGER|1
Name=STRING|"[test psw var] Zip Selected File"
OnErrorTaskID=INTEGER|-1
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
Action7=FOLDER
Action8=FOLDER
[Actions\Action1]
ActionID=STRING|"A_DIALOG_OPEN"
Enabled=INTEGER|-1
Name=STRING|"Open Dialog"
Params=FOLDER
[Actions\Action1\Params]
caption=STRING|"Open File to Zip"
default=STRING|"None"
filter=STRING|"Text files|*.txt|All files|*.*|"
folder=STRING|"C:\"
variable=STRING|"FILETOZIP"
[Actions\Action2]
ActionID=STRING|"A_VARIABLES_SET"
Enabled=INTEGER|-1
Name=STRING|"Set variable ""_psw"" with value ""MyPassword"""
Params=FOLDER
[Actions\Action2\Params]
_rt_variables_produced=STRING|"_psw"
expand=STRING|"0"
linecount=STRING|"1"
varname=STRING|"_psw"
varvalue=STRING|"MyPassword"
[Actions\Action3]
ActionID=STRING|"A_FLOW_IF"
Enabled=INTEGER|-1
Name=STRING|"If Then"
Params=FOLDER
[Actions\Action3\Params]
case=STRING|"0"
operator=STRING|"1"
type=STRING|"0"
value1=STRING|"FILETOZIP"
value2=STRING|"None"
[Actions\Action4]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""file {FILETOZIP}"""
Params=FOLDER
[Actions\Action4\Params]
icon=STRING|"1"
msg0=STRING|"file {FILETOZIP}"
msg1=STRING|"ZIP file {FILETOZIP}.zip"
msgcount=STRING|"2"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action5]
ActionID=STRING|"A_ZIP_PACK"
Enabled=INTEGER|-1
Name=STRING|"Pack Files"
Params=FOLDER
[Actions\Action5\Params]
action=STRING|"0"
coment0=STRING|"{DateTime}, {DayOfWeek}"
coment1=STRING|"This zip-archive created by RoboTask"
comentcount=STRING|"2"
compreslevel=STRING|"1"
destfile=STRING|"{FILETOZIP}.zip"
file0=STRING|"{FILETOZIP}"
filecount=STRING|"1"
includeemptydirs=STRING|"0"
includesubfolders=STRING|"1"
incsysandhidden=STRING|"0"
junkdirnames=STRING|"0"
password=STRING|"4383941112429244395841112"
split=STRING|"0"
unit=STRING|"0"
[Actions\Action6]
ActionID=STRING|"A_FLOW_ELSE"
Enabled=INTEGER|-1
Name=STRING|"Else"
[Actions\Action7]
ActionID=STRING|"A_DIALOG_MESSAGE"
Enabled=INTEGER|-1
Name=STRING|"Show ""You clicked Cancel"""
Params=FOLDER
[Actions\Action7\Params]
icon=STRING|"1"
msg0=STRING|"You clicked Cancel"
msgcount=STRING|"1"
playsound=STRING|"0"
showmessage=STRING|"1"
[Actions\Action8]
ActionID=STRING|"A_FLOW_ENDIF"
Enabled=INTEGER|-1
Name=STRING|"End If"
Save the task text to a file and use the Task->Import menu to import the task into RoboTask.
Also you can simply copy task text and paste it into the task list.