How to address the Windows root directory on Terminal Server using the %_Windows% variable
SummaryColumbus scripts running in a user session (Columbus [UserAdd], [UserRepeat] and [UserRemove] sections) may not access the 'real' Windows root directory of a Terminal Server but only the copy in the user profile.
Columbus scripts running in a user session (Columbus [UserAdd], [UserRepeat] and [UserRemove] sections) may not access the 'real' Windows root directory of a Terminal Server but only the copy in the user profile.
On Windows Terminal Server environments every user receives a 'copy' of the Windows root directory (c:\winnt). If you open a session to the Terminal Server and go on the DOS Prompt typing 'SET', you will see for the variable 'windir' a value that points to the users profile. This is what Microsoft wants you to access in order to protect the system from misbehaving programs overwriting each others INI files and other risks.
Columbus uses internal variables to address file locations of the system, for this directory the variable is called "_Windows". Checking this variable will return you the same value as 'windir'. If you however check the values of these variables in the system space where Columbus service makes its installation of [ServerAdd] and [ClientAdd] sections, they will point to the physical directory (e.g. c:\winnt). So far so good, every thing works fine when the package runs. But what if you need from the [UserAdd] section explicitely to address the real \winnt directory to copy for example some common files to your user Home share ? In order to resolve this need, we have added to Columbus 5 and higher an additional variable which allows you to address this directory called %_WindowsInstallDir%. This variable allways points to the \winnt directory and not to the users copy. Sample If you want to copy some files from the folder c:\winnt\myfiles\ to the users copy of the Windows home directory, you may just add the following line in the [UserAdd] or [UserRepeat] section:
copy '%_WindowsInstallDir%\myfiles\*.*' to '%_Windows%\myfiles\' /-r /newer /sub