reading software version from registry

  • Thread starter Thread starter james
  • Start date Start date
J

james

I would like to read the MacAfee software version stored in the registry
(string data) from the loginscript and append the result to a file. This
entry is in :

HKEY_LOCAL_MACHINE\SOFTWARE\Network Associates\TVD\VirusScan

The string value name is szCurrentVersionNumber & what I am looking for is
the string value data. It is this data that I went to dump into a file when
the user logs in (something like 4.5.1.1306).

Thanks
 
This VBScript should work. Watch for line wrap.

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")

WScript.Echo WshShell.RegRead("HKLM\SOFTWARE\Network
Associates\TVD\VirusScan\szCurrentVersionNumber")

--

Regards,

Dave Patrick ....Please no email replies - reply in newsgroup.
Microsoft MVP [Windows NT/2000 Operating Systems]
 
In said:
This VBScript should work. Watch for line wrap.

Dim WshShell
Set WshShell = WScript.CreateObject("WScript.Shell")

WScript.Echo WshShell.RegRead("HKLM\SOFTWARE\Network
Associates\TVD\VirusScan\szCurrentVersionNumber")
OP,
If you have disabled scripting you might make a batch solution using
REG.EXE (from the Support Tools) or possibly using psinfo.exe from
www.sysyinternals.com. I have no such software to test these ideas
though.
 
Thank you both for your response. I tried all the solutions you provided &
all work. I still have one question. In the vbscript below, how can I dump
the output into a variable? That is, instead of echoing the output to the
screen, I save it to a variable ? Thanks
 
james said:
Thank you both for your response. I tried all the solutions you provided &
all work. I still have one question. In the vbscript below, how can I dump
the output into a variable? That is, instead of echoing the output to the
screen, I save it to a variable ? Thanks

Hi

Set WshShell = CreateObject("WScript.Shell")

sVer = WshShell.RegRead _
("HKLM\SOFTWARE\Network Associates\TVD\VirusScan\szCurrentVersionNumber")

' echo the variable:
WScript.Echo sVer
 
Back
Top