Solved

Pushing registry setting to User Shell Folders w. Group Policy Preferences (escape key needed)

Posted on 2012-03-22
4
1,538 Views
Last Modified: 2012-04-16
Introduction:
Place yourself in the registrybranch Explorer (fullpath is HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer). Two keys holds profile-related path-values:

Key 1
Name: Shell Folders
Type: REG_SZ
Charateristics: When not explicitly set in Group policy, literal paths are used (ie C:\Documents and Settings\carl\appdata)

Key 2
Name: User Shell Folders
Type: REG_EXPAND_SZ
Charateristics: When not explicitly set in Group policy, relative paths are used (ie %USERPROFILE%\Application Data)

Having used redirection I  need to bring the appdata-settings back to default from redirected using Group Policy Preferences (Disabling redirection in Group Policy does not change the appdata setting back to the default, hence the hole issue).

Changing the REG_SZ-settings (Shell Folders) is not an issue, but the REG_EXPAND__SZ (User Shell Folders) is.

The Data that needs to be written to the Appdata value is exactly %USERPROFILE%\Application Data, but when I do as per the image underneath:
Preference-setting%Userprofile% is translated into C:\Documents and Settings\<username>, as illustrated in the next picture:
Unwanted resultIf i could only escape the %-character like in program languages (In Powershell I would ie use the escape-character ` if i wanted to escape ",$ etc).

Any input is greatly appreciated...

Anders from Randers, Denmark
0
Comment
Question by:jmateknik
  • 2
  • 2
4 Comments
 
LVL 82

Expert Comment

by:oBdA
Comment Utility
Use two percent signs wherever you need one:
%%USERPROFILE%%\Application Data
0
 
LVL 1

Author Comment

by:jmateknik
Comment Utility
Have you succesfully done that?
Because I actually tried that prior to creating this thread with no luck.
0
 
LVL 82

Accepted Solution

by:
oBdA earned 500 total points
Comment Utility
Sorry, that works in batch scripts, but not in GPP.
In GPP, enclose the variable in "<>":
%<USERPROFILE>%\Application Data
0
 
LVL 1

Author Comment

by:jmateknik
Comment Utility
My apologies for returning this late. A to effective Outlook rule and a busy life...

How did you know the answer - testing or working at MS?

It works - thank you :-)
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

NTFS file system has been developed by Microsoft that is widely used by Windows NT operating system and its advanced versions. It is the mostly used over FAT file system as it provides superior features like reliability, security, storage, efficienc…
Resolve DNS query failed errors for Exchange
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now