/build/static/layout/Breadcrumb_cap_w.png

Batch file for version check of a specific application, installed on machine

Hi,

Can someone guide me, how do I write a batch file which will do a version check of a specific installed application?

Thanks


0 Comments   [ + ] Show comments

Answers (3)

Posted by: SMal.tmcc 11 years ago
Red Belt
2

you can use wmic to check file versions in a batch file.

wmic datafile where name='c:\\windows\\system32\\notepad.exe' get version

Posted by: SnowLyric 11 years ago
Second Degree Brown Belt
0

Powershell script :)

[System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Windows\system32\notepad.exe").FileVersion

Posted by: Rvlieburg 11 years ago
Third Degree Blue Belt
0

Here is an example how you can pipe output of a vbscript check version to the batch command line:

Set wshshell = CreateObject("WScript.Shell")
Set filesys = CreateObject("Scripting.FileSystemObject")
on error resume next

if filesys.FileExists("c:\program files\Skype\Phone\Skype.exe") then FILEVERSION = filesys.GetFileVersion("c:\program files\Skype\Phone\Skype.exe")
if filesys.FileExists("c:\program files (x86)\Skype\Phone\Skype.exe") then FILEVERSION = filesys.GetFileVersion("c:\program files (x86)\Skype\Phone\Skype.exe")
if FILEVERSION = VERSION then
wscript.quit 0
else
wscript.quit 1626
end if

 

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login

Share

 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ