Solved

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

Posted on 2012-03-22
4
1,556 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 83

Expert Comment

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

Author Comment

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

Accepted Solution

by:
oBdA earned 500 total points
ID: 37756966
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
ID: 37850094
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

Zoho SalesIQ

Hassle-free live chat software re-imagined for business growth. 2 users, always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I am going to show you how to simulate a multi-site Lab environment on a single Hyper-V host. I use this method successfully in my own lab to simulate three fully routed global AD Sites on a Windows 10 Hyper-V host.
This script can help you clean up your user profile database by comparing profiles to Active Directory users in a particular OU, and removing the profiles that don't match.
This Micro Tutorial will give you a basic overview of Windows DVD Burner through its features and interface. This will be demonstrated using Windows 7 operating system.
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

910 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

18 Experts available now in Live!

Get 1:1 Help Now