Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Vista Newsgroups > Vista General

Vista - determine version of .exe thru batch file

Reply
 
Old 06-02-2009   #1 (permalink)


Windows Vista Enterprise 32-bit
 
 

determine version of .exe thru batch file

I have been researching a way to check the version of a file thru a batch file; i found the filever.exe utility, but then discovered it is not compatable with Vista.

Is there a way to do this in Vista? My goal is to create a batch file that compares the version of an .exe that is locally installed to the "current" version on a server, replace the local version if it doesn't match, and then open the local version.

in searching i found a command in one of the forums here (can't find that post now to save my life!) that i believe was intended to check the version of a dll, but in the example that was given they used an .exe - so i was hoping to get it to work for me, but i'm getting errors.

Here's what i'm trying:
$env:"C:\Program Files\ProgramFolder\Program.exe".VersionInfo | fl *
and here's what i'm getting:
The filename, directory name, or volume label syntax is incorrect.
Help with this method or the correct method would be GREATLY appreciated!

thanks in advance!

Rebekah
Ft. Rucker

My System SpecsSystem Spec
Old 06-02-2009   #2 (permalink)
Jon


 
 

Re: determine version of .exe thru batch file

"woodrg" <guest@xxxxxx-email.com> wrote in message
news:aaa81b15813aad49e67f5ea66c62ddbb@xxxxxx-gateway.com...
Quote:

>
> I have been researching a way to check the version of a file thru a
> batch file; i found the filever.exe utility, but then discovered it is
> not compatable with Vista.
>
> Is there a way to do this in Vista? My goal is to create a batch file
> that compares the version of an .exe that is locally installed to the
> "current" version on a server, replace the local version if it doesn't
> match, and then open the local version.
>
> in searching i found a command in one of the forums here (can't find
> that post now to save my life!) that i believe was intended to check the
> version of a dll, but in the example that was given they used an .exe -
> so i was hoping to get it to work for me, but i'm getting errors.
>
> Here's what i'm trying:
> $env:"C:\Program Files\ProgramFolder\Program.exe".VersionInfo |
> fl *
> and here's what i'm getting:
> The filename, directory name, or volume label syntax is
> incorrect.
> Help with this method or the correct method would be GREATLY
> appreciated!
>
> thanks in advance!
>



The code you've got there looks like Powershell code, rather than cmd.exe
code, so it won't work as is in a cmd.exe shell.

If you've installed Powershell (a free download) then you can do something
like

(Get-Command "$env:ProgramFiles\Windows
Sidebar\sidebar.exe").FileVersionInfo.FileVersion

which looks similar to the code you posted. Example output .......

PS (1) > (Get-Command "$env:ProgramFiles\Windows
Sidebar\sidebar.exe").FileVersionInfo.Fil
eVersion
6.0.6000.16615 (vista_gdr.071215-2230)
PS (2) >


Alternatively if you're keen on batch files, then filever.exe seems to work
ok here with Vista and cmd.exe. I don't know what particular issues you're
having ......

"D:\Program Files\Support Tools\filever.exe" /d "C:\Program Files\Windows
Sidebar\sidebar.exe"

--a-- W32i APP ENU 6.0.6000.16615 shp sidebar.exe


--
Jon


My System SpecsSystem Spec
Old 06-02-2009   #3 (permalink)


Windows Vista Enterprise 32-bit
 
 

Re: determine version of .exe thru batch file

hmm, i tried to download it and received errors indicating it was not compatible and then found several posts indicating that it was not. i guess i'll regroup and try again.

Thanks for the insight.
My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Determine File Version of a dll PowerShell
Determine OS version and bit type from the registry Vista General
How can I determine if an install version is 32bit or 64 bit? Vista installation & setup
How to determine a batch file is running as administrator General Discussion
Determine installed SQL Version and Edition VB Script


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46