Previous Topic: fetch—Fetching ItemsNext Topic: Example


Use of the % Sign

Assume that on both, the enterprise and the domain manager, the environment variable %SAMPLES% is defined, but on the enterprise the variable is pointing to "c:\samples", while on the domain manager it is pointing to "g:\examples".

All txt files should be fetched. Now launching the following command from the Windows command prompt

cadsmcmd fetch item=sample path=%SAMPLE%\*.txt area=domain_manager

will result in an error or unexpected results. Because SAMPLES is defined on the enterprise manager the command prompt will resolve the variable and launch the cadsmcmd with the following path parameter:

path=c:\samples\*.txt

To avoid the variables resolution by the Windows command prompt the percent sign has to be escaped from being interpreted by the command prompt. This is done by preceding the percent sign with a caret "^".

Therefore, in the following invocation, all parameters will by passed unmodified by the command prompt to the cadsmcmd and the environment variable SAMPLES will be resolved at the domain manager's site:

cadsmcmd fetch item=samples path=^%SAMPLES^%\*.txt area=domain_manager