Solved

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

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Disabling the Directory Sync Service Account in Office 365 will stop directory synchronization from working.
Last week, our Skyport webinar on “How to secure your Active Directory” (https://www.experts-exchange.com/videos/5810/Webinar-Is-Your-Active-Directory-as-Secure-as-You-Think.html) provided 218 attendees with a step-by-step guide for identifying Acti…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles to another domain controller. Log onto the new domain controller with a user account t…

776 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