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

Please log in to comment

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

Please log in to comment

Answers

0

Powershell script :)

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

Answered 04/04/2013 by: SnowLyric
Second Degree Brown Belt

Please log in to comment
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

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