Quantcast
Channel: VBForums - ASP, VB Script
Viewing all articles
Browse latest Browse all 686

append registry key script not working correctly

$
0
0
Good morning

i have a scenario where i need a value of a registry key to be appended with the original value still retained and added to

the value for example is hkcu\software\test with a string value of 100
i need this to be appended to ,200 so the key looks 100,200
the issue is this is overwriting the value altogether which i dont want

i have the following code
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "test"
strValueName = "english"
strValue = "200"
objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, strValue

I also need a check for the script to say if ,200 doesnt exist then run the script

can anyone advise please?

Viewing all articles
Browse latest Browse all 686

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>