I created a registry item in a GPO of REG_EXPAND_SZ type with value "%userprofile%\Shares". The problem is, when the GPO is aplied, the value is created with the data "C:\Users\Default\Shares". Is there a way to mantain the value "%userprofile%\Shares" without automatically replacing the variable inside it?
2 Answers
See if this helps:
"%<userprofile>%\Shares"
Found the answer here https://sdmsoftware.com/forums/topic/escaping-env-variable-while-using-gpp/
You can insert <> between the variable name to prevent auto resolution, so instead of using %userprofile%, I used %<userprofile>% and it worked!