Hi All,
We use a script to read some DAT version of McAfee etc from a few desktops, and that works good. When we use this script te read from the registry of a Thin Client (HP t5720) then no values are returned. We cant find why we get nothing returned. The values and keys are at the exact location as they are on the workstations and we have admin rights on the Thin Clients.
The script we use is pasted below.
Does any of you know why we get nothing returned from the HP thin client?
Cheers
**************************
**********
**********
**********
**********
**********
**********
**********
*
On Error Resume Next
Const ForReading = 1
Const HKEY_LOCAL_MACHINE = &H80000002
x = 2
'Create an Excel Work Sheet
Set objExcel = CreateObject("Excel.Applic
ation")
objExcel.Visible = True
objExcel.Workbooks.Add
objExcel.Cells(1, 1).Value = "Machine Name"
objExcel.Cells(1, 2).Value = "Product"
objExcel.Cells(1, 3).Value = "McAfee Version"
objExcel.Cells(1, 4).Value = "McAfee Scan Engine"
objExcel.Cells(1, 5).Value = "Virus Definition"
objExcel.Cells(1, 6).Value = "Virus Definition Date"
objExcel.Cells(1, 7).Value = "Report Time Stamp"
objExcel.Range("A1:G1").Se
lect
objExcel.Selection.Interio
r.ColorInd
ex = 19
objExcel.Selection.Font.Co
lorIndex = 11
objExcel.Selection.Font.Bo
ld = True
objExcel.Cells.EntireColum
n.AutoFit
'Read machine names from a txt file
Set Fso = CreateObject("Scripting.Fi
leSystemOb
ject")
Set InputFile = fso.OpenTextFile("MachineL
ist.Txt")
Do While Not (InputFile.atEndOfStream)
strComputer = InputFile.ReadLine
intRow = x
objExcel.Cells(intRow, 1).Value = strComputer
GetRegInfo
objExcel.Cells(intRow, 7).Value = Now()
set strValue1 = Nothing
set strValue2 = Nothing
set strValue3 = Nothing
set strValue4 = Nothing
set strValue5 = Nothing
x = x + 1
Loop
Wscript.Echo "Done"
'*************************
**********
**********
**********
**********
**********
**********
**********
**********
'Get information from Registry
Sub GetRegInfo
Set oReg=GetObject( _
"winmgmts:{impersonationLe
vel=impers
onate}!\\"
&_
strComputer & "\root\default:StdRegProv"
)
strKeyPath = "SOFTWARE\Network Associates\TVD\VirusScan Enterprise\CurrentVersion"
strProduct = "Product"
strProductVer = "szProductVer"
strEngineVer = "szEngineVer"
strVirDefVer = "szVirDefVer"
strVirDefDate = "szVirDefDate"
oReg.GetStringValue _
HKEY_LOCAL_MACHINE,strKeyP
ath,strPro
duct,strVa
lue1
objExcel.Cells(intRow, 2).Value = strValue1
oReg.GetStringValue _
HKEY_LOCAL_MACHINE,strKeyP
ath,strPro
ductVer,st
rValue2
objExcel.Cells(intRow, 3).Value = strValue2
oReg.GetStringValue _
HKEY_LOCAL_MACHINE,strKeyP
ath,strEng
ineVer,str
Value3
objExcel.Cells(intRow, 4).Value = strValue3
oReg.GetStringValue _
HKEY_LOCAL_MACHINE,strKeyP
ath,strVir
DefVer,str
Value4
objExcel.Cells(intRow, 5).Value = strValue4
oReg.GetStringValue _
HKEY_LOCAL_MACHINE,strKeyP
ath,strVir
DefDate,st
rValue5
objExcel.Cells(intRow, 6).Value = strValue5
End Sub
**************************
**********
**********
**********
**********
**********
**********
**********
*
Start Free Trial