Hi,

I write an integer to the registry like this:

sho.RegWrite MyLogonValueKey, 1

Later I read it like this:

Dim MyLogonValue

MyLogonValue = sho.RegRead(MyLogonValueKey)

But it seems it is read like the character "1". How can I save it or
read it like an *integer* value?

regards

Jake

Re: Read from registry as integer.. by Joe

Joe
Thu Jan 31 03:35:23 CST 2008



"Jake" <jake44@gmail.com> wrote in message
news:OtRhFI#YIHA.4860@TK2MSFTNGP03.phx.gbl...
> Hi,
>
> I write an integer to the registry like this:
>
> sho.RegWrite MyLogonValueKey, 1
>
> Later I read it like this:
>
> Dim MyLogonValue
>
> MyLogonValue = sho.RegRead(MyLogonValueKey)
>
> But it seems it is read like the character "1". How can I save it or read
> it like an *integer* value?
>
> regards
>
> Jake
Suggest you look in the WScript docs ( I presume you are using WSH?).
There is a third parameter to RegWrite to specify the type which defaults to
REG_SZ. You need REG_DWORD.

--

Joe Fawcett (MVP - XML)
http://joe.fawcett.name


Re: Read from registry as integer.. by Todd

Todd
Thu Jan 31 05:20:13 CST 2008

Jake wrote:
> Hi,
>
> I write an integer to the registry like this:
>
> sho.RegWrite MyLogonValueKey, 1
>
> Later I read it like this:
>
> Dim MyLogonValue
>
> MyLogonValue = sho.RegRead(MyLogonValueKey)
>
> But it seems it is read like the character "1". How can I save it or
> read it like an *integer* value?
>
> regards
>
> Jake

MyLogonValue = CInt(sho.RegRead(MyLogonValueKey))

--
Todd Vargo
(Post questions to group only. Remove "z" to email personal messages)


Re: Read from registry as integer.. by Jake

Jake
Thu Jan 31 05:42:58 CST 2008

Todd Vargo wrote:
> Jake wrote:
>> Hi,
>>
>> I write an integer to the registry like this:
>>
>> sho.RegWrite MyLogonValueKey, 1
>>
>> Later I read it like this:
>>
>> Dim MyLogonValue
>>
>> MyLogonValue = sho.RegRead(MyLogonValueKey)
>>
>> But it seems it is read like the character "1". How can I save it or
>> read it like an *integer* value?
>>
>> regards
>>
>> Jake
>
> MyLogonValue = CInt(sho.RegRead(MyLogonValueKey))
>

Thanks both!!