Hello, I am completely new to VB scripting.  I have a powershell script that needs to work in VB.  Here is the powershell version:

 

$version = Get-FileVersionInfo C:\ProgramData\folder*\filename.exe
if ($version.FileVersion -like '10.5.8*')
    {return $version.FileVersion}
    else
    {}

Summary of script: There is an executable (filename.exe) that lives in c:\ProgramData\foldername.  The full path to the .exe is different on every installation, so it could be in c:\programdata\foldername1234\filename.exe, or c:\programdata\foldername2345\filename.exe, etc.

I need to check the file version of the .exe, see if its like a certain version, if so, return the version number, if not, return null.

Any help would be FANTASTIC!!!

2 Comments   [ + ] Show Comments

Comments

  • Try this:

    http://www.activexperts.com/network-monitor/windowsmanagement/adminscripts/
  • 'vbscript
    Dim file1
    Dim version

    FILE1 = "C:\ProgramData\folder*\filename.exe"
    version = ("10.5.8*")

    Set objFSO = CreateObject("Scripting.FileSystemObject")

    If objFSO.GetFileVersion(FILE1) - like version Then
    WshShell.run(path To executable)
    end if
Please log in to comment

Answers

0

This will help you :)


'vbscript

Dim file1

Dim version

FILE1 = "C:\ProgramData\folder*\filename.exe"

version = ("10.5.8*")

Set objFSO = CreateObject("Scripting.FileSystemObject")

If objFSO.GetFileVersion(FILE1) - like version Then

WshShell.run(path To executable)

end if

Answered 04/26/2015 by: hvasudeva
White Belt

Please log in to comment
Answer this question or Comment on this question for clarity