By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,341 Members | 1,700 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,341 IT Pros & Developers. It's quick & easy.

Writing to registry - REG_BINARY type

P: n/a
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\C ommon\MailSettings]
"ReplyFontSimple"=hex:3c,00,00,00,0f,00,00,e8,00,0 0,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
----------------------------------------

TIA!
Mike D.
Jul 24 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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." <no***************@ohyeah.coma écrit dans le message de news:
%2****************@TK2MSFTNGP06.phx.gbl...
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\C ommon\MailSettings]
"ReplyFontSimple"=hex:3c,00,00,00,0f,00,00,e8,00,0 0,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
----------------------------------------

TIA!
Mike D.

Jul 24 '07 #2

P: n/a
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" <http://www.chez.com/scribe/a écrit dans le message de news:
e7**************@TK2MSFTNGP03.phx.gbl...
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." <no***************@ohyeah.coma écrit dans le message de news:
%2****************@TK2MSFTNGP06.phx.gbl...
>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\C ommon\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,0 0,00,00,00,00,00,00,00,00,\
00,00,00,00,58,df,66,34,8c,ea,13,00,01,00,00,00
----------------------------------------

TIA!
Mike D.


Jul 24 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.