Writing to registry - REG_BINARY type

M

Mike D.

Hi All,

Did an export from the registry (see below). This is what I need to have
written to the registry programmatically from my VB.NET utility. As you can
see it is multi-line and binary data. Had no problems with the other
entries written to the registry using:
Dim shell as Object
shell.RegWrite(strRegDir, strSigName, "REG_EXPAND_SZ")

----------------------------------------
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Common\MailSettings]
"ReplyFontSimple"=hex:3c,00,00,00,0f,00,00,e8,00,00,00,00,c8,00,00,00,d8,01,59,\
00,00,00,ff,00,00,20,41,72,69,61,6c,00,44,05,0e,00,00,00,00,00,00,00,00,00,\
00,00,00,00,58,df,66,34,8c,ea,13,00,01,00,00,00
 
P

Patrice

Have you tried the Microsoft.Win32 namespace that provides registry
functions ?

IMO always favor what .NET provides (IMO this is not supported by WShell).
 
P

Patrice

Finally gave this a try. It would give something such as :

Dim a() As Byte = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26}
My.Computer.Registry.SetValue("HKEY_CURRENT_USER\a", "T", a,
Microsoft.Win32.RegistryValueKind.Binary)

(2.0, use Microsoft.Win32 to do the same in previous releases).

---
Patrice


Patrice said:
Have you tried the Microsoft.Win32 namespace that provides registry
functions ?

IMO always favor what .NET provides (IMO this is not supported by WShell).

--
Patrice


Mike D. said:
Hi All,

Did an export from the registry (see below). This is what I need to have
written to the registry programmatically from my VB.NET utility. As you
can see it is multi-line and binary data. Had no problems with the other
entries written to the registry using:
Dim shell as Object
shell.RegWrite(strRegDir, strSigName, "REG_EXPAND_SZ")

----------------------------------------
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Office\10.0\Common\MailSettings]
"ReplyFontSimple"=hex:3c,00,00,00,0f,00,00,e8,00,00,00,00,c8,00,00,00,d8,01,59,\

00,00,00,ff,00,00,20,41,72,69,61,6c,00,44,05,0e,00,00,00,00,00,00,00,00,00,\
00,00,00,00,58,df,66,34,8c,ea,13,00,01,00,00,00
 
Top