Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Reg query not working in Vbscript

$
0
0

Hi,

I am to querying two registry path to get McAfee lastheckupdate value (i.e one is in 32bit and 64 bit windows version). The problem now is when I do a query like below it query only the first registry path and getting an error " Microsoft VBScript runtime error: Type mismatch"Can anyone please check and let me know how to fix this ?

hDefKey = HKEY_LOCAL_MACHINE
strComputer = line
Set StdOut = WScript.StdOut
Set oReg=GetObject( _
    "winmgmts:{impersonationLevel=impersonate}!\\" &_ 
    strComputer & "\root\default:StdRegProv")

Dim regValueExists,strValue1,StringValue1,objFSO


StrKeyPath = "SOFTWARE\Wow6432Node\Network Associates\TVD\Shared Components\Framework"
strValueName = "LastUpdateCheck"
strKeyPath1 = "SOFTWARE\Network Associates\TVD\Shared Components\Framework"
strValueName1 = "LastUpdateCheck"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath1,strValueName1,strValue1

Set objFSO = CreateObject("Scripting.FileSystemObject")
If objFSO.FolderExists("C:\Program Files (x86)") Then

oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
WScript.Echo "SOFTWARE\Wow6432Node\Network Associates\TVD\Shared Components\Framework" _
    & "CrashControl\LastUpdateCheck" _
    & " = " & strValue
LastUpdateCheck = strValue
wscript.echo LastUpdateCheck

Else


WScript.Echo "SOFTWARE\Network Associates\TVD\Shared Components\Framework" _
    & "CrashControl\LastUpdateCheck" _
    & " = " & strValue1

LastUpdateCheck = strValue1
wscript.echo LastUpdateCheck

End If

output.WriteLine Hostname & "," & LastUpdateCheck




Viewing all articles
Browse latest Browse all 15028

Trending Articles



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