Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirecting "My Documents" from citrix server to local workstation

Status
Not open for further replies.

BeerGood

IS-IT--Management
Sep 4, 2002
190
AU
There are a number of descriptions on how to redirect user's "My Documents" folder from the server, but most talk about moving it to another server share eg \\server\user$

I came across an issue the other day where the requirement was to have "My Documents" directed to the users workstation. Now the first thing that comes to mind is using a GPO but unfortunately this did not work because the workstation drive mapping (in this case C: became V:) was not available until *after* the policy had been applied. This meant that moving the folder failed.

The solution I came up with was to use a kix script to edit the users registry files as follows:

Code:
; -----------------------------------------------------------------
; Kixtart Version:	Kixtart 2001 V4.20
; Developers: 		beergood
; Company: 		ninkasi.com
; -----------------------------------------------------------------

BREAK OFF
$Script_version="1.01"
$VarSet = SetTitle("Citrix Config Script - Ver. "+$Script_version)
$VarSet = SetOption("ASCII","ON")
$VarSet = SetOption("DisableDebugging","ON")
$MyDocDrive = "V:" ;// set location of local drive for citrix client // 

;****************************************************************************************
;*** Fix location of My Documents etc then exit
;****************************************************************************************

WRITEVALUE ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Desktop", $MyDocDrive+"\Documents and Settings\"+@userid+"\Desktop", "REG_EXPAND_SZ");// Set Desktop location to local drive //
WRITEVALUE ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Desktop", $MyDocDrive+"\Documents and Settings\"+@userid+"\Desktop", "REG_SZ");

WRITEVALUE ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "Personal", $MyDocDrive+"\Documents and Settings\"+@userid+"\My Documents", "REG_EXPAND_SZ");// Set My Documents location to local drive //
WRITEVALUE ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "Personal", $MyDocDrive+"\Documents and Settings\"+@userid+"\My Documents", "REG_SZ");

WRITEVALUE ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders", "My Pictures", $MyDocDrive+"\Documents and Settings\"+@userid+"\My Documents\My Pictures", "REG_EXPAND_SZ");// Set My Pictures location to local drive //
WRITEVALUE ("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders", "My Pictures", $MyDocDrive+"\Documents and Settings\"+@userid+"\My Documents\My Pictures", "REG_SZ");

exit
EndIf

Maybe not perfect (for example there's no error checking should a user login to Citrix using a different account to the one they logged into on the workstation, plus it's win2k/xp specific, but all those could be solved if required), but it seems to work as it is for this company! Now when users try to save stuff to the desktop or to their "My Documents" it gets dumped onto the local workstation rather than trying to save it on the server. Hopefully this might help some people - when I have the chance I might make this a FAQ so it doesn't get lost! Cheers.
 
Thanks for the tip, it's nice to see people share their experiences and solutions on the board!!
 
BeerGood,
Kindly give a step by step instruction on how to successfully implement this code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top