Mr_Chicken,

We had to do a similar thing in our Citrix Environment:
 Code:
    $envirolocation='HKCU\Environment'
    $temp=ReadValue($envirolocation,'TEMP')
    $tmp=ReadValue($envirolocation,'TMP')
    $tmpvar=Chr(37)+Chr(83)+Chr(121)+Chr(115)+Chr(116)+Chr(101)+Chr(109)+Chr(68)+Chr(114)+Chr(105)+Chr(118)+Chr(101)+Chr(37)
    IF $temp='' OR $temp='N:\TEMP'
       $rc=WriteValue($envirolocation,'TEMP',$tmpvar+'\Temp','REG_EXPAND_SZ')
    ENDIF
    IF $tmp='' OR $tmp='N:\TEMP'
       $rc=WriteValue($envirolocation,'TMP',$tmpvar+'\Temp','REG_EXPAND_SZ')
    ENDIF

    $newtmpval=ReadValue($envirolocation,'TEMP')

    IF %temp%=''
       SET 'TEMP='+$newtmpval
    ENDIF

    IF %tmp%=''
       SET 'TMP='+$newtmpval
    ENDIF


If you need to know what the chr() codes are, go to: http://asciitable.com

HTH,

Kent


Edited by Kdyer (2008-08-25 08:54 PM)
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's