Edit Reg_binary with VBScript?

I'm looking for a simple VBScript to edit a REG_BINARY registry value. Please note that I'd like to edit an existing value, I don't need to create a new value.
Thanks in advance!
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

In what way are you wanting to edit it...?
seoproAuthor Commented:
Thanks for your response!I'd like to add value without deleting the current value.
Basically, you'll need to read the current value, insert your new portion, and rewrite the entire value...
Have an example key of what you're trying to do?
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

seoproAuthor Commented:
Thanks for your response.Let's start with reading:I've tried to use regread message and then output it with a msgbox, But received "type mismatch" error.So what's the correct way to read long reg_binary values?
Here's a good starter for reading binary values...uses WMI.
Let me know if you need further help with it.


const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_ 
strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft\Windows NT\CurrentVersion"
strValueName = "LicenseInfo"
oReg.GetBinaryValue HKEY_LOCAL_MACHINE,strKeyPath,_
For i = lBound(strValue) to uBound(strValue)
    StdOut.WriteLine  strValue(i)

Open in new window


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
seoproAuthor Commented:
One question, Though:
const HKEY_LOCAL_MACHINE = &H80000002
What if I need to read HKEY_CURRENT_USER without the root/administrative access?
Thanks in advance!
Use another constant... ;^)

const HKEY_CURRENT_USER = &H80000001

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.