I've tried using RegRead which doesn't error but I can't diplay or store the
values. I want to be able to modify some of the values in the string based
on position and then write the modified values back to the registry. Do I
need to somehow read the values into an array?
Perhaps it returns a byte array or something instead of a string?
Have you tried:
Dim vValue
Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")
vValue = WshShell.RegRead("YOUR_KEY")
WScript.Echo vValue(0)
Does this work?
-Chad
"Dave" <ma...@ihug.co.nz> wrote in message news:O3coV5pQAHA.247@cppssbbsa03...
sKey = "HKEY_CURRENT_USER\mykey\binKey\"
set shell = createobject("wscript.shell")
val = shell.regread(sKey)
msgbox typename(val)
msgbox typename(val(0))
msgbox val(0)
--
Michael Harris
Microsoft.MVP.Scripting
--
"Chad Myers" <cmy...@NOSPAM.austin.rr.com> wrote in message news:OpDoMDqQAHA.246@cppssbbsa04...
Dave
"Michael Harris" <Please....@To.NewsGroup> wrote in message
news:ulN$i1qQA...@cppssbbsa02.microsoft.com...
The last line gives me a type mismatch. If I try
WshShell.RegWrite "HKCU\MyKey\Test\", answer(5)
I don't get any errors but the registry value doesn't change.
I've tried looking in the WSH and VBscript documentation downloaded from
microsoft and looked in other WSH reference sources but I can't find out how
to do this.
"Michael Harris" <Please....@To.NewsGroup> wrote in message
news:ulN$i1qQA...@cppssbbsa02.microsoft.com...
> As of WSH 2.0, you should be getting an array with elements that are
variants of subtype byte.
>
> sKey = "HKEY_CURRENT_USER\mykey\binKey\"
> set shell = createobject("wscript.shell")
> val = shell.regread(sKey)
> msgbox typename(val)
> msgbox typename(val(0))
> msgbox val(0)
>
> --
> Michael Harris
> Microsoft.MVP.Scripting
> --
>
>
> >
str = ""
for each char in answer
datum = right( "00" & hex(char), 2 )
str = datum & str
next
WshShell.RegWrite "HKCU\MyKey\Test\", "&h" & str, REG_BINARY
"Dave" <ma...@NOSPAM.ihug.co.nz> wrote in message
news:8tofct$pal$1...@lust.ihug.co.nz...
--
Michael Harris
Microsoft.MVP.Scripting
--
"Dave" <ma...@NOSPAM.ihug.co.nz> wrote in message news:8tofct$pal$1...@lust.ihug.co.nz...