Outline ·
[ Standard ] ·
Linear+
.NET Writing binary value to registry, vb.net
|
TSshoden
|
Apr 3 2009, 03:34 PM, updated 17y ago
|
Getting Started

|
Hello sifoo, A simple question for you but not me. I got this registry file CODE Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\AttachmentExecute\{0002DF01-0000-0000-C000-000000000046}] "Excel.Sheet.8"=hex(0): "Word.Document.8"=hex(0): "Excel.Sheet.12"=hex(0): "Word.Document.12"=hex(0):
I want to write it using vb.net maybe somebody can help. I write something like this but not working. CODE My.Computer.Registry.SetValue("HKEY_CURRENT_USER\Software\Microsoft\Windows\Shell\AttachmentExecute\{0002DF01-0000-0000-C000-000000000046}", "Excel.Sheet.8", hex(0), RegistryValueKind.Binary)
|
|
|
|
|
|
vickizack
|
Apr 6 2009, 03:00 PM
|
Getting Started

|
include microsoft script runtime
Set objShell = WScript.CreateObject("WScript.Shell") objShell.RegWrite "HKEY_LOCAL_MACHINE\\Type", "XXX" , "REG_BINARY"
|
|
|
|
|
|
TSshoden
|
Apr 6 2009, 04:57 PM
|
Getting Started

|
QUOTE(vickizack @ Apr 6 2009, 03:00 PM) include microsoft script runtime Set objShell = WScript.CreateObject("WScript.Shell") objShell.RegWrite "HKEY_LOCAL_MACHINE\\Type", "XXX" , "REG_BINARY" Thanks for your reply but i'm looking for pure .net code and didn't use any legacy object/reference. Anyone?
|
|
|
|
|
|
liquor1
|
Apr 10 2009, 01:30 PM
|
Getting Started

|
CODE Dim val(0) As Byte val(0) = 0 Dim regKey As Microsoft.Win32.RegistryKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("Software\Microsoft\Windows\Shell\AttachmentExecute\{0002DF01-0000-0000-C000-000000000046}") regKey.SetValue("Excel.Sheet.8", val, Microsoft.Win32.RegistryValueKind.Binary) regKey.Flush() regKey.Close()
if u wan to set binary value... u use byte array
|
|
|
|
|