When executing a dms script manually with dmscript following error occurs "Unknown variable: COMPUTERPATH"
On Windows following message appears:
<Please see attached file for image>
On Unix/Linux following message appears:
<Please see attached file for image>
This problem occurs if the DMS script is using a predefined AM string constant like ComputerPath and this variable has not be initialized.
On Windows
dmscript.exe executes a command like this in order to generate a file with values for all AM constants :
amagentsvc "/computerscriptvars=c:\users\Administrator\AppData\Local\Temp\dms6717.tmp"
But if AM Agent is running at the same time, this command fails and dmscript executes the DMS script without initialization of AM constants. It is why ComputerPath is not defined.
The solution is :
or
amagentsvc "/computerscriptvars=c:\temp\script.ini"
and execute dmscript with parameter -i_dms. This command will work even if AM Agent is running :
dmscript test.dms "-i_dms: F:\temp\script.ini"
<Please see attached file for image>
On Unix/Linux
The file with AM constants is stored under file $CA_ITRM_BASEDIR/Agent/AM/data/config/script.ini
Remark :
This file is created on the machine if at least one AM job of type script is attached to the machine.
If the file does not exist, create a small test script AM job and attach it on the machine. Then execute "caf start amagent".
This will create the file $CA_ITRM_BASEDIR/Agent/AM/data/config/script.ini
Then execute these command lines :
cp $CA_ITRM_BASEDIR/Agent/AM/data/config/script.ini /tmp
dmscript test.dms -i_dms: /tmp/script.ini
<Please see attached file for image>
src="/servlet/servlet.FileDownload?file=0150c000004AKSGAA4" alt="3.jpg" width="723" height="176">
See following link for a list of "Asset Management Scripting Language Predefined String Constants" :