Login | |
|
 |
RE: check if certain programs are installed - 8/1/2006 11:56:26 PM
|
|
 |
|
| |
Country73
Posts: 735
Score: 10
Status: offline
|
Post the script that you are currently using to list the installed programs; then maybe we can assist in modifying it to search for specific software that is installed.
|
|
| |
|
|
|
 |
RE: check if certain programs are installed - 8/2/2006 2:21:28 AM
|
|
 |
|
| |
Country73
Posts: 735
Score: 10
Status: offline
|
I adjusted your script so that it looks for McAfee VirusScan Enterprise, so that I could test it out. Since you have multiples that you want to look for, you may want to put in a "SELECT CASE strValue" to get your desired results. Modified script: '======================================================= Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE strComputer = "." strKey = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" strEntry1a = "DisplayName" strEntry1b = "QuietDisplayName" strEntry2 = "InstallDate" strEntry3 = "VersionMajor" strEntry4 = "VersionMinor" strEntry5 = "EstimatedSize" Set objReg = GetObject("winmgmts://" & strComputer & "/root/default:StdRegProv") objReg.EnumKey HKLM, strKey, arrSubkeys WScript.Echo "Installed Applications" & VbCrLf For Each strSubkey In arrSubkeys intRet1 = objReg.GetStringValue(HKLM, strKey & strSubkey, _ strEntry1a, strValue1) If intRet1 <> 0 Then objReg.GetStringValue HKLM, strKey & strSubkey, _ strEntry1b, strValue1 End If If strValue1 <> "" Then IF strValue1 = "McAfee VirusScan Enterprise" THEN WScript.Echo VbCrLf & "Display Name: " & strValue1 'End If - This was your original END IF objReg.GetStringValue HKLM, strKey & strSubkey, strEntry2, strValue2 If strValue2 <> "" Then WScript.Echo "Install Date: " & strValue2 End If objReg.GetDWORDValue HKLM, strKey & strSubkey, strEntry3, intValue3 objReg.GetDWORDValue HKLM, strKey & strSubkey, strEntry4, intValue4 If intValue3 <> "" Then WScript.Echo "Version: " & intValue3 & "." & intValue4 End If objReg.GetDWORDValue HKLM, strKey & strSubkey, strEntry5, intValue5 If intValue5 <> "" Then WScript.Echo "Estimated Size: " & Round(intValue5/1024, 3) & " megabytes" End If END IF END IF Next '=======================================================
< Message edited by Country73 -- 8/2/2006 2:23:13 AM >
|
|
| |
|
|
|
| |
|
|
 |
|
 |
|
|