Copy registry values from one key to another using VBScript

Hi all, I hope somebody can help out here.
I need a VBScript to copy registry values (values and types are unknown and may vary) from one key to another key.   Can somebody please show me how to do this

Many thanks

Greg
gjm762Asked:
Who is Participating?
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.

ns_germanyCommented:
Hi Greg,

pls have a look at http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/registry/#EnumRegVals.htm.
You'll find every kind of VBScript registry action: determining value types, reading and writing it, regarding key security etc.
I think it's just a copy-and-paste job for you to get the lines you need.

If VBScript is new to you pls let us know what to do exactly so we can create the script for you, OK?

Cheers,
Norbert
LongbowCommented:
Put the next lines in a .vbs file.

Set WshShell = Wscript.CreateObject("Wscript.Shell")

'Read the value of DefaultUserName :
reg = WSHShell.RegRead ("HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName")

Replace the value with "AnotherName" :
WSHShell.RegWrite ("HKLM\Software\Microsoft\Windows NT\CurrentVersion\Winlogon\DefaultUserName"), "AnotherName" ,"REG_SZ"

'Data Types :
'REG_DWORD
'REG_BINARY
'REG_EXPAND_SZ


RegWrite Method:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthregwrite.asp

RegRead Method:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/wsmthregread.asp

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
gjm762Author Commented:
Great ...Thanks
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
Operating Systems

From novice to tech pro — start learning today.