Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2012-03-22
4
Medium Priority
?
1,686 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 2000 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

In the absence of a fully-fledged GPO Management product like AGPM, the script in this article will provide you with a simple way to watch the domain (or a select OU) for GPOs changes and automatically take backups when policies are added, removed o…
A bad practice commonly found during an account life cycle is to set its password to an initial, insecure password. The Password Reset Tool was developed to make the password reset process easier and more secure.
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.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

636 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