I’m writing a small C# program that changes some hardcoded paths in the windows registry. My problems are REG_EXPAND_SZ Values that contain environment variables. Example:
%APPDATA%\Microsoft\Installer\
If i query this value using GetValue(), i get the path for %APPDATA%. But i dont want it to lookup the environment variable.
I cant exclude such values because they may contain hardcoded paths that are important.
Use the
RegistryValueOptions.DoNotExpandEnvironmentNamesoption when you callGetValue.