I'm trying to copy a registry key and its values to another key.
I can get the value of type REG_EXPAND_SZ keys but it looks like the string
value is expanded in the process. As I am trying to copy from one key to
another I would like to get the unexanded value. Here briefly, is how I'm
getting the key:
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &
strComputer & "\root\default:StdRegProv")
oReg.GetExpandedStringValue hive,keypath,name,strValue
StdOut.WriteLine " " & strValue
Printing strValue out shows the expanded value.
Where the content of the value "name" might be "This is the path: %PATH%"
the actual printed value will show the expanded value of %PATH%.
I want to copy that value as is to the new key:name. Is there a way to get
the unexpanded value? I tried using oReg.GetStringValue but it operated the
same way as the oReg.GetExpandedStringValue function.
Any help would be appreciated