Yerk
asked on
Set REG_EXPAND_SZ" value in the registry
Hi all,
This code create a REG_SZ value, I want to create a REG_EXPAND_SZ value !
Dim regKey As RegistryKey
regKey = RegistryKey.OpenRemoteBase Key(Regist ryHive.Loc alMachine, strComputer)
regKey = regKey.OpenSubKey("SYSTEM\ CurrentCon trolSet\Se rvices\MyS ervice", True)
regKey.SetValue("Path", "%systemroot%\system32" & Chr(0))
regKey.Close()
ARGH!
Do you have any idea ?
Thanks in advance,
Didier
This code create a REG_SZ value, I want to create a REG_EXPAND_SZ value !
Dim regKey As RegistryKey
regKey = RegistryKey.OpenRemoteBase
regKey = regKey.OpenSubKey("SYSTEM\
regKey.SetValue("Path", "%systemroot%\system32" & Chr(0))
regKey.Close()
ARGH!
Do you have any idea ?
Thanks in advance,
Didier
ASKER
Thanks for your help, if you have any examples, they are welcome...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks a lot, your code makes the job perfectly
Didier
Didier
Here is a quote from the .Net documentation:
There is no way to control whether the information being passed is stored as an sz, or an expanded_sz string, and therefore, all string values are interpreted as standard sz values.
Let us know if you need examples....