![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | add value I am trying to add a value with a binary of 00,00,00,00 to the Explorer key, but all this does is add a key under the explorer key. WshShell.Run ("reg add HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\link=hex:00,00,00,00") I would to add the value "link" to the explorer key with a binary of 00 00 00 00. You can not do it with a vbscript because it will only write 4 bytes, that's 00 00 not 8 0s. Need help. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: add value Dim SH Set SH = CreateObject("WScript.Shell") SH.RegWrite "HKLM\Software\test1", CLng(0), "REG_BINARY" Set SH = Nothing Quote: > I am trying to add a value with a binary of 00,00,00,00 to the > Explorer key, but all this does is add a key under the explorer key. > WshShell.Run ("reg add > ") Quote: > > I would to add the value "link" to the explorer key with a binary of 00 00 > 00 00. > You can not do it with a vbscript because it will only write 4 bytes, Quote: > 00 00 not 8 0s. Bytes are typically shown as 2-character hexadecimal values that reprersent a number between 0 and 255: 00 A1 00 D0 FF I doubt it all makes much difference, anyway. 4-byte binary values are usually long integers, the same as dword values. While binary is often used to "hide" text strings or record long numeric lists, I don't remember ever seeing a 4-byte binary value that was anything more than a numeric value stored in a poorly-chosen way. If you really want to store a numeric value it would be easier to just store it as a dword value. |
My System Specs![]() |
| | #3 (permalink) |
| | Re: add value That's was easy!! Thanks it works great. Every where I look all I could fine was that a vbscript could on write 4 bytes to a reg_binary. "mayayana" <mayaXXyana@xxxxxx> wrote in message news:#3VmWmn8IHA.2060@xxxxxx Quote: > Dim SH > Set SH = CreateObject("WScript.Shell") > SH.RegWrite "HKLM\Software\test1", CLng(0), "REG_BINARY" > Set SH = Nothing > > Quote: >> I am trying to add a value with a binary of 00,00,00,00 to the >> Explorer key, but all this does is add a key under the explorer key. >> WshShell.Run ("reg add >> > ") Quote: >> >> I would to add the value "link" to the explorer key with a binary of 00 >> 00 >> 00 00. >> You can not do it with a vbscript because it will only write 4 bytes, Quote: >> 00 00 not 8 0s. > Each byte is 2 of the zeros, so 8 zeros IS 4 bytes. > Bytes are typically shown as 2-character hexadecimal > values that reprersent a number between 0 and 255: > 00 A1 00 D0 FF > > I doubt it all makes much difference, anyway. 4-byte > binary values are usually long integers, the same as > dword values. While binary is often used to "hide" text > strings or record long numeric lists, I don't remember > ever seeing a 4-byte binary value that was anything > more than a numeric value stored in a poorly-chosen > way. If you really want to store a numeric value it > would be easier to just store it as a dword value. > > > |
My System Specs![]() |
| | #4 (permalink) |
| | Re: add value Quote: > That's was easy!! Thanks it works great. Every where I look all I could > fine was that a vbscript could on write 4 bytes to a reg_binary. > actually 2 bytes. For some reason VBS defaults to writing a short integer value (2 bytes) unless you force it to be a long integer with CLng. If you want to write anything more than that you can use the SetBinaryValue method of StdRegProv. (Requires that WMI be installed and running.) You can also try to construct a .reg file and merge it, but that's a bit awkward. |
My System Specs![]() |
| | #5 (permalink) |
| | Re: add value Ok, Thanks for the info. "mayayana" <mayaXXyana@xxxxxx> wrote in message news:#JXjq8o8IHA.1196@xxxxxx Quote: > Quote: >> That's was easy!! Thanks it works great. Every where I look all I could >> fine was that a vbscript could on write 4 bytes to a reg_binary. >> > That is true. The 00 00 00 00 is 4 bytes. The 00 00 is > actually 2 bytes. For some reason VBS defaults to writing > a short integer value (2 bytes) unless you force it to be > a long integer with CLng. If you want to write anything > more than that you can use the SetBinaryValue method > of StdRegProv. (Requires that WMI be installed and running.) > You can also try to construct a .reg file and merge it, > but that's a bit awkward. > > > |
My System Specs![]() |
![]() |
| Thread Tools | |
| |