Link to home
Start Free TrialLog in
Avatar of Yerk
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.OpenRemoteBaseKey(RegistryHive.LocalMachine, strComputer)
                        regKey = regKey.OpenSubKey("SYSTEM\CurrentControlSet\Services\MyService", True)
                        regKey.SetValue("Path", "%systemroot%\system32" & Chr(0))
                        regKey.Close()
ARGH!

Do you have any idea ?

Thanks in advance,

Didier


Avatar of graye
graye
Flag of United States of America image

Sorry... you're gonna have to use the Win32 DLL versions or the WMI Registry provider.

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....
Avatar of Yerk
Yerk

ASKER

Thanks for your help, if you have any examples, they are welcome...

ASKER CERTIFIED SOLUTION
Avatar of graye
graye
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Yerk

ASKER

Thanks a lot, your code makes the job perfectly

Didier