Solved

get program version number

Posted on 2007-12-05
4
674 Views
Last Modified: 2008-02-01
i have a vb exe that i am copying into production.  the output of this is piped to a text file.  is there anyway i can get the version number of the exe so i can also send it to the text file.

for example: if i currently have version 1.1.3 in and i want to move in 1.1.4 i would need to get the version on the old file and the new file and pipe that output to the file.

thanks
0
Comment
Question by:Fraser_Admin
  • 2
4 Comments
 

Author Comment

by:Fraser_Admin
ID: 20412177
can get the program version using vbscript, but cannot figure out how to return the value to my calling program (batch file).  any ideas here?
0
 
LVL 9

Expert Comment

by:MSE-dwells
ID: 20414930
Show us how you're doing whatever you've got so far.
0
 

Author Comment

by:Fraser_Admin
ID: 20415057
i ended up just put the output to a file now i'm comparing the two files to see if the version is the same.
0
 
LVL 14

Accepted Solution

by:
canali earned 500 total points
ID: 20416231
Something like this?
byBye Gastone Canali
@echo off
::
:: getfilever.cmd
:: byBye Gastone Canali 
setlocal
pushd %~d0%~p0
set filename=%~n0
set logfile="%temp%\_%filename%.txt"
:: create empty log files
type nul>%logfile%
set newver=1.1.4
set pathToYourExe="C:\Program files\Internet Explorer\iexplore.exe"
 
call :_GETVER  %pathToYourExe%
echo Version: %v%
rem checkversion
echo %v% | find /v "%oldver%" >nul && call :_diffVER %newver% >>%logfile%
echo Version: %v% >>%logfile%
 
goto :_END
:_diffVER
rem  version is different:do something...
echo The file is the not new version %1 but %v%
goto :_EOF
:_GETVER
:: create vbs helper 
:: (every time the funtion is called, put on top of the batch if u don't like it)
 call :_CREATEVBSHELPER
 if not exist %1 goto :_ERR
 for /f "delims=!" %%v in ('cscript //nologo %temp%\filever.vbs %1') do set v=%%v
goto :_EOF
:_CREATEVBSHELPER
set vbshelper=%temp%\filever.vbs
echo>%vbshelper%  Set objFSO = CreateObject("Scripting.FileSystemObject")
echo>>%vbshelper% Wscript.Echo objFSO.GetFileVersion(wscript.arguments(0))
goto :_EOF
:_ERR
set v= file not found!
:_END
:_EOF

Open in new window

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
how to pick file up from ftp via batch file 2 73
Carriage Return in Batch File 5 70
Issue while creating batch file using powershell 4 73
Windows updates batch files 7 102
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
You may have already been in the need to update a whole folder stucture using a script. Robocopy does it well and even provides a list of non-updated files in a log (if asked to). Generally those files that were locked by a user or a process by the …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question