Deployment Solution

 View Only
  • 1.  vbscript to verify application version

    Posted May 31, 2009 02:52 AM
    Hi there,

    I am looking how to run a vbscript from Deployment Console (6.9), which will check if  version "C:\Program Files\Mozilla Firefox\firefox.exe" is equal or less than 3.0.4, then run firefox.exe (3.0.10)

    I was trying to test
     
    "Function GetOfficeVersion(strComputer)
    Set objWMI = GetObject("winmgmts:\\" & strComputer & "\root\CIMV2")
    Set colItems = objWMI.ExecQuery( _
    "SELECT Version FROM Win32_Product WHERE Name Like ' ")"

    but I could not go anywhere, because of my basic vbscript knowledge, if you have any sample I will appreciate if you could share it...thanks


  • 2.  RE: vbscript to verify application version

    Posted Jun 01, 2009 02:11 PM
    Try this:

    'vbscript
    dim verNum
    Set objFSO = CreateObject("Scripting.FileSystemObject")

    verNum= objFSO.GetFileVersion("C:\Program Files\Mozilla Firefox\firefox.exe")

    If Left(verNum,5)<3.0.5 then <path_to_executable>


  • 3.  RE: vbscript to verify application version
    Best Answer

    Posted Jun 02, 2009 02:41 PM

    I like how that counted the charactors over. ...Or you could do this:


    'vbscript
    dim file1
    dim version

    FILE1 = "C:\Program Files\Mozilla Firefox\firefox.exe"
    version = ("3.0.4")
    Set objFSO = CreateObject("Scripting.FileSystemObject")

    If objFSO.GetFileVersion(FILE1) < version Then
    WshShell.run(path to executable)

    end if
     



  • 4.  RE: vbscript to verify application version

    Posted Jun 02, 2009 09:45 PM
    Thanks for the hints, much appreciated

    I tried If Left(verNum,5)<3.0.5 then <path_to_executable>, but I got error , Line 7 char 22 expected Then, but I did not know how to fix it sorry

    I tried If objFSO.GetFileVersion(FILE1) < version Then WshShell.run(path to executable). for this one I needed to add Set WshShell  and it worked fine

    thanks for your help....