Solved

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

Posted on 2012-03-22
4
1,622 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 85

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 85

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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

Uncontrolled local administrators groups within any organization pose a huge security risk. Because these groups are locally managed it becomes difficult to audit and maintain them.
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

696 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