Good afternoon
I have the below script which should amend values in HKLM
it should read the value from strvaluename and then this is the oldvalue, then set a new string value which prefixes with the strvalue
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Wow6432Node\Interwoven\Worksite\Client\FileSite\Commands\Workspace\"
strValueName = "Commands"
strValue = ",-,printBarcode.printBC@Print Barcode"
objRegistry.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, oldValue
newValue = oldValue & "," & strValue
objRegistry.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, newValue
This works fine as HKCU as shown in the below script
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Internet Explorer\International\"
strValueName = "AcceptLanguage"
strValue = "en-GB;Q=0.5"
objRegistry.GetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, oldValue
newValue = oldValue & "," & strValue
objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, newValue
Can anyone advise why when I alter the path to HKLM it no longer works please?
Regards
I have the below script which should amend values in HKLM
it should read the value from strvaluename and then this is the oldvalue, then set a new string value which prefixes with the strvalue
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Wow6432Node\Interwoven\Worksite\Client\FileSite\Commands\Workspace\"
strValueName = "Commands"
strValue = ",-,printBarcode.printBC@Print Barcode"
objRegistry.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, oldValue
newValue = oldValue & "," & strValue
objRegistry.SetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, newValue
This works fine as HKCU as shown in the below script
Const HKEY_CURRENT_USER = &H80000001
strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "Software\Microsoft\Internet Explorer\International\"
strValueName = "AcceptLanguage"
strValue = "en-GB;Q=0.5"
objRegistry.GetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, oldValue
newValue = oldValue & "," & strValue
objRegistry.SetStringValue HKEY_CURRENT_USER, strKeyPath, strValueName, newValue
Can anyone advise why when I alter the path to HKLM it no longer works please?
Regards