I have a situation where I need to return a directory path by reading the registry settings. Registry value returns me a path in the format
%CommonProgramFiles%\
Environment.ExpandEnvironmentVariables. If you control the creation of the registry value, store it as an expandable string in the registry and the registry API will automatically expand it for you.