|
|
|||||||
Hi, I´m having truble checking "My Documents" location. I´m gonna redirect it but I wanna check if it´s already redirected ie not default. Below is a script that doesn´t work if I type the $pers it will show %userprofie%\my documents but when checking the variale it will goto Endif. Whats wrong? Code: If ingroup ("Citrix") $Pers=Readvalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Personal") ? $Pers If $Pers= "%USERPROFILE%\My Documents" Writevalue("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "H:\", REG_EXPAND_SZ) If Not exist "H:\Citrix My Documents" MD "H:\Citrix My Documents" Endif SHELL '%COMSPEC% /e:1024 /c xcopy /s /c /r /y "%userprofile%\My Documents\*.*" "H:\Citrix My Documents" >nul' Endif Endif |
||||||||
|
|
|||||||
Alterd the scipt a bit. Does it work like this? Code: If InGroup ("Citrix") $Pers = ExpandEnvironmentVars(ReadValue("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Personal")) If InStr ($Pers, "c:\documents and settings") WriteValue("HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "H:\", REG_EXPAND_SZ) If Not Exist "H:\Citrix My Documents" MD "H:\Citrix My Documents" EndIf Copy "%userprofile%\My Documents\" "H:\Citrix My Documents\" EndIf EndIf |
||||||||
|
|
|||||||
Thanx Mart That solved the problem. |
||||||||
|
|
|||||||
Yeah. Sometimes environment vars (%stuff%) does not get translated to the actual value by kix. ExpandEnviromentVars solves that. |