Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Vista General Discussion > determine version of .exe thru batch file

Reply
Thread Tools Display Modes

determine version of .exe thru batch file

 
 
woodrg
Guest
Posts: n/a

 
      06-02-2009

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


--
woodrg
 
Reply With Quote
 
 
 
 
Jon
Guest
Posts: n/a

 
      06-02-2009
"woodrg" <> wrote in message
news:...
>
> 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


 
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to determine if I have pilot version of WGA Notifications Jim Windows Update 4 09-27-2009 07:38 AM
How can I determine if an install version is 32bit or 64 bit? Timmer Windows Vista Installation 6 02-07-2009 03:58 AM
Determine OS version and bit type from the registry RobM Windows Vista General Discussion 7 12-02-2008 10:49 PM
Setup cannot determine if this computer supports this version of W DannyBoy Windows Vista Installation 2 10-05-2006 11:56 PM
Re: how to determine .net framework version Nicholas Windows Update 0 09-08-2003 03:31 PM



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 47 48 49 50 51 52 53 54 55 56 57 58 59