Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBScript to get Installed application information

Status
Not open for further replies.

win2kguy

Instructor
Apr 24, 2001
1
US
Does anyone know how I would use VBScript to determine what applications are installed on a system? Any help would be greatly appreciated.
 
Here's some code I put together to do something similar. I have a page where the user can click a link (which has an id="startapp") and launch a local application. This may be different than what you're after since I'm looking for a specific app and not polling all installed apps.

Code:
Sub startapp_OnClick
   Dim strAppPath, strTestPath
   Dim MyObj
   Dim fso, drives, drive

   strTestPath = ":\PROGRA~1\AppName\AppName.exe"
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set drives = fso.Drives

  For Each drive In drives
      If Drive.DriveLetter <> &quot;A&quot; Then 
         If fso.FileExists(Drive.DriveLetter&strTestPath) Then strAppPath = Drive.DriveLetter&strTestPath
      End If
   Next

   Set MyObj = CreateObject(&quot;WScript.Shell&quot;)

   If strAppPath <> &quot;&quot; Then 
      MyObj.Run strAppPath 
   Else 
      MsgBox &quot;Application could not be found on your system&quot;
   End If 

   Set MyObj = Nothing
   Set fso = Nothing
End Sub

Hope this helps.
'UNLESS someone like you
cares a whole awful lot,
nothing is going to get better.
It´s not.'
(The Lorax, by Dr. Seuss)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top