/build/static/layout/Breadcrumb_cap_w.png

Software Deployment Question


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

04/04/2013 29774 views

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

Comments



Community Chosen Answer

2

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

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

Answered 04/04/2013 by: SMal.tmcc
Red Belt

All Answers

0

Powershell script :)

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

Answered 04/04/2013 by: SnowLyric
Second Degree Brown 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

 

Answered 04/08/2013 by: Rvlieburg
Third Degree Blue Belt

 
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