Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


check if certain programs are installed

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,36642
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> check if certain programs are installed
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 check if certain programs are installed - 8/1/2006 2:44:28 AM   
  msp

 

Posts: 4
Score: 0
Joined: 8/1/2006
Status: offline
I'm new to scripting but I was looking for a client logon script which will check if a set of programs are installed on that machine (eg anti virus) if one of the programs isn't installed it should come up with an error stating which program isn't installed. All help welcome.
 
 
Post #: 1
 
 RE: check if certain programs are installed - 8/1/2006 3:26:01 AM   
  ebgreen


Posts: 5246
Score: 31
Joined: 7/12/2005
Status: online
Search these fora for keywords like "list installed applications".

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to msp)
 
 
Post #: 2
 
 RE: check if certain programs are installed - 8/1/2006 7:51:23 PM   
  msp

 

Posts: 4
Score: 0
Joined: 8/1/2006
Status: offline
Can't seem to find anything relevant, I've got a script which will list all the installed programs but I'm struggling with a script which will check for certain programs (possibly through reg keys) and give error messages if required. Any help welcome.

(in reply to ebgreen)
 
 
Post #: 3
 
 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.

(in reply to msp)
 
 
Post #: 4
 
 RE: check if certain programs are installed - 8/2/2006 12:55:54 AM   
  msp

 

Posts: 4
Score: 0
Joined: 8/1/2006
Status: offline
See all installed apps:

      

Check for file:

      

(in reply to Country73)
 
 
Post #: 5
 
 RE: check if certain programs are installed - 8/2/2006 1:03:25 AM   
  ebgreen


Posts: 5246
Score: 31
Joined: 7/12/2005
Status: online
So does the app that you want to search for appear in the list of all installed apps?

_____________________________

"... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to msp)
 
 
Post #: 6
 
 RE: check if certain programs are installed - 8/2/2006 1:59:15 AM   
  msp

 

Posts: 4
Score: 0
Joined: 8/1/2006
Status: offline
About 50 apps appear on this list and the ones I need to check at logon do appear in the list when that script is run.

(in reply to ebgreen)
 
 
Post #: 7
 
 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 >

(in reply to msp)
 
 
Post #: 8
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> check if certain programs are installed Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts