This problem occurs if the DMS script is using a predefined AM string constant like ComputerPath and this variable has not be initialized.
dmscript.exe executes a command like this in order to generate a file with values for all AM constants :
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 :
- Wait that AM Agent is terminated before executing dmscript.
- Execute this command when AM Agent is not running :
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"
The file with AM constants is stored under file $CA_ITRM_BASEDIR/Agent/AM/data/config/script.ini
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