Link to home
Start Free TrialLog in
Avatar of mvwmail
mvwmail

asked on

Repointing My Documents with Registry entry or command line

I am creating ZENWORKS application objects on version 3.2, to run on Windows XP. We have started to use Group Policy for the machine policies now, and it is pretty locked down.

However, as this is NOT an AD domain, I need to repoint the My Documetns folder to another location via another method, and deploy this as a script, registry key, or command line.

Can it be done?
Avatar of Tony Massa
Tony Massa
Flag of United States of America image

REG.exe is a command-line registry editor.  Since the "My Documents" is a user setting, you would have to configure a logon script for the users to run this command.

reg.exe query "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders"  /v Personal

will show you the registry value

You would use the reg.exe delete and reg.exe Add commands in succession to change the value of Personal.  For example

reg.exe delete "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v Personal /f
reg.exe Add  "HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders" /v TestPersonal /t REG_SZ /d \\ServerName\ShareName\%username%

-TM
Avatar of RubenvdLinden
RubenvdLinden

You can copy the registry information below to a .REG file and import it into a ZENworks application object.

Personal = My Documents
My Pictures = My Pictures
Favorites = Internet Explorer Favorites

All you need to do is fill in the path to the network folder. Make sure you separate folders with two slashes instead of one (e.g. H:\\USERNAME\\HOMEFOLDER)


Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders]
"Favorites"="PATH_TO_YOUR_NETWORK_FOLDER"
"Personal"="PATH_TO_YOUR_NETWORK_FOLDER"
"My Pictures"="PATH_TO_YOUR_NETWORK_FOLDER"
Sounds like a lot of work... why not just use Zenworks to do it, that's what it's designed for.

Download this adm template - http://www.novell.com/coolsolutions/tools/14324.html
and tada... shell folder redirection via Zen group policy.
I vote for alextoft's solution.  If he hadn't already posted the folder redirection adm file link, I would have...

OR,

use the registry info the others gave you but rather than using reg.exe or importing a reg file into ZEN, you can manually create the keys and values in an application object.  If you are pointing them to a folder in their home directory, make sure to use the built-in %Home Directory% macro in the new path.  If you're using a different directory structure you can combine custom macros and built-in macros to build the path.

Set the value to "create always" and set the Run Options to "Install Only" and do not set "run once."   Associate it to all the users you want the redirection to happen for.

Keep in mind that whatever way you go - it's a change to the registry.  Even if you use the custom ADM template, it doesn't automatically reverse itself like regular group-policy changes do - even if you disable GP this change will stick even though it was done through GP.

I believe, however, if you set the "uninstall" feature for an app object, it will back it out if the app is unassociated to the user.  In theory.
 
ShineOn: Why wouldn't you import a reg file, but create the keys manually instead?
Because you'd have to create the .reg file anyway in order to import it, and then you'd have to massage the values to use ZEN macros.  May as well enter it once.
Avatar of mvwmail

ASKER

I will check them all soon, and thanks for the feedback, got a day in Paddington regretfully so wont be able to work on this till tomorrow
Another option is to modify the user Group Policy settings through ConsoleOne on an XP machine.   You then have the option to do whatever you want the a GP provides support for.  You then assign the GP to a Group and dump the users in there.  That way you get all the advantages of Group Policy but don't have to support an AD domain.  There are lots of other settings in there as well to allow you to customize your environment.
Unfortunately, with Windows XP Microsoft changed local group policy so you can no longer do "my documents" redirection with local group policy.  It's reserved now for AD domain group policy.  

It shouldn't be, but Microsoft does what they do because they can get away with it.

You used to be able to do it with ZEN policies and even using the local group policy templates IIRC, but not any more, because of Microsoft and their anticompetitive ways.  That's why some industrious admin made the folder redirection .ADM template that alextoft posted a link to.
ShineOn, that is interesting I was unaware of that.  I will have to take a look.  Thanks for the info.
No problem.
Why delete this question? There are multiple good answers here.
I would suggest a split of points.
Yes, good, and all valid, answers.  Someone might get benefit from this as a PAQ.
ASKER CERTIFIED SOLUTION
Avatar of Computer101
Computer101
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial