Quantcast
Viewing all articles
Browse latest Browse all 9

Re:Help with reg checks (does it exist, access denied, able to read, able to write/modify?) (a_ahmed)

It's legacy web based software that uses an ancient activex so one of the things we must enable is this in advanced options:
 
"allow software to run or install even if the signature is invalid"
 
As an example does this:
 
 'Read Registry Value Function   
 Function ReadRegValue(Hive, KeyPath, ValueName, ValueType) '1=string, 2=dword, 3=bin   
 select case ValueType   
 Case 1		objReg.GetStringValue Hive,KeyPath,ValueName,Value  
 Case 2 		objReg.GetDWORDValue Hive,KeyPath,ValueName,Value  
 Case 3		objReg.GetBinaryValue Hive,KeyPath,ValueName,Value  
 end select   
 ReadRegValue = Value
 End Function       
 LogWrite("[IE ADVANCED SETTINGS: 'Allow software to run or install even if the signature is invalid']")   
 strKeyPath = "Software\Microsoft\Internet Explorer\Download"   
 strOptionKey = "RunInvalidSignatures"dwvalue = 1   
 LogWrite("a. {READING CURRENT SETTING}")   
 LogWrite("")   
 LogWrite("Accessing: HKCU\" & strKeyPath)   
 SettingResult = ReadRegValue (HKCU, strKeyPath, strOptionKey,2)   
 LogWrite("DWORD " & strOptionKey & " = " & SettingResult)   
 If IsNull(SettingResult) Then      
 LogWrite("The registry value does not exist.")   
 elseif SettingResult="" then   
 LogWrite("The registry value is blank.")   
 elseif SettingResult=1 then   
 LogWrite("Setting checked")   
 elseif SettingResult=0 then   
 LogWrite("Setting unchecked")   
 else   
 LogWrite("Unknown")   
 End If   
 LogWrite("")   
 '3b. Set settingLogWrite("b. {CONFIGURING SETTING}")   
 LogWrite("")    
 On Error Resume Next   
 LogWrite("Writing to: HKCU\" & strKeyPath)   
 objReg.CreateKey HKCU, strKeyPath   
 Err.Clear   
 On Error GoTo 0    
 LogWrite("Setting DWORD " & strOptionKey & " = " & dwValue)   
 LogWrite("Setting checked")   
 objReg.SetDWORDValue HKCU,strKeyPath,strOptionKey,dwValue   
 LogWrite("") 

 
But now what if you can't raed the value at all? What if you can't write the value, it'll throw some kind of code right... so I need to write in a routine here...

Viewing all articles
Browse latest Browse all 9

Trending Articles