Hi nt32msngns,
Thanks for your post.
I am not sure I understand you very well. Can you explain your request in
more details? Normally, when we write an expandable environment variable
into the registry, it will not be expanded. For example, the code snippet
below will write the string "%path%" into the registry:
RegistryKey test9999 =
Registry.CurrentUser.CreateSubKey("Test9999");
test9999.SetValue("expandable string", "%PATH%");
If your request is how to write an expandable string into the registry or
is how to read %path% into the actual file system path, I think we can use
Environment.ExpandEnvironmentVariables to get this done. Something like
this:
RegistryKey test9999 =
Registry.CurrentUser.CreateSubKey("Test9999");
test9999.SetValue("expandable string",
Environment.ExpandEnvironmentVariables("%PATH%"));
Hope this helps.
If I misunderstand you, please feel free to tell me. Thanks
Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Get Secure! -
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.