Reading/Writing Hex values from the registry 
Author Message
 Reading/Writing Hex values from the registry

Hello,

How can I read/write Hex values from/to the registry using RegRead/RegWrite?
When I try to read a hex value such as 00 01 00 00 00 I get invalid data
type error messages.  Can someone kindly tell me how toI manipulate the hex
values using WSH?
Thanks

Deb



Wed, 04 Sep 2002 03:00:00 GMT  
 Reading/Writing Hex values from the registry
You want  CInt(RegVal)
--
Mark L. Ferguson  Please reply in newsgroup
marfers notes for OE5 >  http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm
Quote:

> Hello,

> How can I read/write Hex values from/to the registry using RegRead/RegWrite?
> When I try to read a hex value such as 00 01 00 00 00 I get invalid data
> type error messages.  Can someone kindly tell me how toI manipulate the hex
> values using WSH?
> Thanks

> Deb



Thu, 05 Sep 2002 03:00:00 GMT  
 Reading/Writing Hex values from the registry
None of the conversion functions worked for me.

Example:
iCallAccess=
CInt(WSHShell.RegRead("HKLM\System\CurrentControlSet\System\Services\RemoteA
ccess\CallAccess\enabled")
MsgBox iCallAccess
MsgBox CStr(iCallAccess)
etc..
iCallAccess remains empty string

the enabled value is either 00 00 00 00 or 01 00 00 00
Thanks,

Deb


You want  CInt(RegVal)
--
Mark L. Ferguson  Please reply in newsgroup
marfers notes for OE5 >
http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm

Quote:
> Hello,

> How can I read/write Hex values from/to the registry using
RegRead/RegWrite?
> When I try to read a hex value such as 00 01 00 00 00 I get invalid data
> type error messages.  Can someone kindly tell me how toI manipulate the
hex
> values using WSH?
> Thanks

> Deb



Thu, 05 Sep 2002 03:00:00 GMT  
 Reading/Writing Hex values from the registry
My key for remote access differs from yours :

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\RemoteAccess

(no second System key)

--
Mark L. Ferguson  Please reply in newsgroup
marfers notes for OE5 >  http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm

Quote:

> None of the conversion functions worked for me.

> Example:
> iCallAccess=
> CInt(WSHShell.RegRead("HKLM\System\CurrentControlSet\System\Services\RemoteA
> ccess\CallAccess\enabled")
> MsgBox iCallAccess
> MsgBox CStr(iCallAccess)
> etc..
> iCallAccess remains empty string

> the enabled value is either 00 00 00 00 or 01 00 00 00
> Thanks,

> Deb


> You want  CInt(RegVal)
> --
> Mark L. Ferguson  Please reply in newsgroup
> marfers notes for OE5 >
> http://www.geocities.com/SiliconValley/Bay/6386/IE_ng_notes.htm


> > Hello,

> > How can I read/write Hex values from/to the registry using
> RegRead/RegWrite?
> > When I try to read a hex value such as 00 01 00 00 00 I get invalid data
> > type error messages.  Can someone kindly tell me how toI manipulate the
> hex
> > values using WSH?
> > Thanks

> > Deb



Thu, 05 Sep 2002 03:00:00 GMT  
 Reading/Writing Hex values from the registry

In WSH 2.0 you get a variant array for REG_BINARY.  Each array element is a variant of subtype Long
representing each binary byte.  You can only RegWrite what will fit in a long (see the RegWrite
documentation).  In WSH 1.0 it was a native byte array (Typename ==> "Byte()" ) which was sort of
{*filter*} to parse.

See the attached script for a (WSH 1.0) work-around originally posted last year by David E.
Stockbridge...  You'll need to adjust the logic for reading binary keys for the WSH 2.0 behavior.

--
Michael Harris
MVP Scripting

Hello,

How can I read/write Hex values from/to the registry using RegRead/RegWrite?
When I try to read a hex value such as 00 01 00 00 00 I get invalid data
type error messages.  Can someone kindly tell me how toI manipulate the hex
values using WSH?
Thanks

Deb

  RegBinReadWrite.vbs
1K Download


Thu, 05 Sep 2002 03:00:00 GMT  
 Reading/Writing Hex values from the registry
In addition to what Michael said, here's a function I got from the Windows
Script Host, Programmer's Ref. by Dino Esposito :

For each char in strRegValue
 datum = Right("00" & HEX(char), 2)
 str = datum & str
next

Anton Bawab
SHA HMS Les Roches


Quote:
> In WSH 2.0 you get a variant array for REG_BINARY.  Each array element is

a variant of subtype Long
Quote:
> representing each binary byte.  You can only RegWrite what will fit in a

long (see the RegWrite
Quote:
> documentation).  In WSH 1.0 it was a native byte array (Typename ==>

"Byte()" ) which was sort of
Quote:
> {*filter*} to parse.

> See the attached script for a (WSH 1.0) work-around originally posted last
year by David E.
> Stockbridge...  You'll need to adjust the logic for reading binary keys

for the WSH 2.0 behavior.
Quote:

> --
> Michael Harris
> MVP Scripting




Quote:
> Hello,

> How can I read/write Hex values from/to the registry using
RegRead/RegWrite?
> When I try to read a hex value such as 00 01 00 00 00 I get invalid data
> type error messages.  Can someone kindly tell me how toI manipulate the
hex
> values using WSH?
> Thanks

> Deb



Fri, 06 Sep 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. How To Write a Hex Value to Registry

2. Read Registry Hex value

3. Writing a VBS file which reads and writes to the registry

4. Writing Hex Entries to the registry

5. Updating Registry With Hex Values

6. Updating Registry With Hex Values

7. Converting hex value in str format to hex

8. How can I Read-Write the registry from a VBScript-Procedure of an outlook-form

9. How can I Read-Write remote registry

10. Read/write registry key using .asp or .hta

11. reading en writing to registry in certain netwerk environments

12. Read/Write Registry with ASP- VBScript

 

 
Powered by phpBB® Forum Software