473,387 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Writing to registry - REG_BINARY type

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
2 5436
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: stelios | last post by:
I am developing an application which at some point must write registry value in the registry of type REG_DWORD_BIG_ENDIAN. Does anyone know what data type i have to use to write...
1
by: Allen Lee | last post by:
The Problem was that when I wanted to use C# to write a REG_BINARY data to registry, it came to me that the method SetValue() of class RegistryKey cannot let me specify the type. What must I do if...
1
by: John Hoffman | last post by:
When reading registry subkey values ... String valstr = rksub.GetValueNames(); foreach (String vs in valstr) { String vstr = rksub.GetValue(vs).ToString(); // RETURNS EXCEPTION ... }
5
by: Dave | last post by:
I'd like to create a Registry key value where the Registry key value type is REG_QWORD. I'm using SetValue(name As String, value As Object), and I understand that the object type used in this...
5
by: Anil Bakirci | last post by:
How can I update the registry, after i change a key value to take effect ? There is nothing usefull in Microsoft.Win32.Registry und Microsoft.Win32.RegistryKey. Wie kann man in .NET ein...
2
by: Srini | last post by:
Hi, Can anyone please tell me how to retrieve meaningful value from registry value in REG_Binary type? I tried to convert REG_Binary value to string using the following code.
2
by: terryastone | last post by:
I have an application that reads some registry values stored in the Local Machine\Software\... key. In XP, I can see these values using RegEdit. In my application I can read the values at...
2
by: =?Utf-8?B?QW5kcmUgS2xpbW92?= | last post by:
Hi! Situation: simple code read registry value (OpenSubKey -GetValue, as usual). Requested value exists in registry and has type DWORD, read into the variable UInt32, access rights granted. ...
5
Sl1ver
by: Sl1ver | last post by:
I have this piece of code public bool Write(string KeyName, object Value) { try { // Setting string subKey1 =...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.