r/vbscript • u/NoPhaseNoKill • Mar 22 '17
Editing registry based off of previously registry value
Hi guys,
I don't know anything any VBS scripting, but basically what I'm wanting to do is the following:
Read a value from key HKCU\Example\Key
And then modify the value from that location to have text "sip:" Infront of it.
If the value of that registry key is initially 'example@email.Com', I'm wanting the value to become 'sip:example@email.com'
1
Upvotes
View all comments
Show parent comment
1
u/NoPhaseNoKill Mar 23 '17
Awesome! Thanks so much for your help.
Let's hypothesis another situation, where it reads the registry value from one one file path, and then changes the registry value of a secondary key, while also adding "sip:".
Example:
HKCU\Example\Key - Has a value of 'example@email.com'
HKCU\Example\Key\Test - Has a default value of '0'
How do I get the HKCU\Example\Key\Test value to equal 'sip:example@email.com'?
Would I simply just create another const 'Const KEY_NAME2 = "HKCU\Example\Key\Test", and then write to that registry value using .RegWrite KEY_NAME2, "sip:" & .RegRead(KEY_NAME)?
Edit: Formatting