If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Rate Thread | Display Modes |
#1
|
|||
|
|||
Windows program version from the command line?
Any of you guys know how to read the version of a Windows program
from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) |
Ads |
#2
|
|||
|
|||
Windows program version from the command line?
Todd wrote:
Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) ver |
#3
|
|||
|
|||
Windows program version from the command line?
On 12/19/2014 08:06 PM, Paul in Houston TX wrote:
Todd wrote: Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) ver $ ver privatefirewall-7.0.30.3.exe Microsoft Windows XP [Version 5.1.2600] Huh. "ver" is giving me the version of Windows, not the program. Rats! |
#4
|
|||
|
|||
Windows program version from the command line?
On 20-December-2014 1:40 PM, Todd wrote:
Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) winver |
#5
|
|||
|
|||
Windows program version from the command line?
On 12/19/2014 09:46 PM, Gavon wrote:
On 20-December-2014 1:40 PM, Todd wrote: Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) winver Hi Gavon, On mine, that pops up a pretty graphic of the Windows version. I am looking for a program's version. The one you get when you use Windows Explorer and right click, properties on the exe's file name. -T |
#6
|
|||
|
|||
Windows program version from the command line?
On 20-December-2014 3:56 PM, Todd wrote:
On 12/19/2014 09:46 PM, Gavon wrote: On 20-December-2014 1:40 PM, Todd wrote: Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) winver Hi Gavon, On mine, that pops up a pretty graphic of the Windows version. I am looking for a program's version. The one you get when you use Windows Explorer and right click, properties on the exe's file name. -T So you need to get the version of a particular .exe file while in a DOS window ?? |
#7
|
|||
|
|||
Windows program version from the command line?
On 12/19/2014 10:13 PM, Gavon wrote:
On 20-December-2014 3:56 PM, Todd wrote: On 12/19/2014 09:46 PM, Gavon wrote: On 20-December-2014 1:40 PM, Todd wrote: Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) winver Hi Gavon, On mine, that pops up a pretty graphic of the Windows version. I am looking for a program's version. The one you get when you use Windows Explorer and right click, properties on the exe's file name. -T So you need to get the version of a particular .exe file while in a DOS window ?? Yes |
#8
|
|||
|
|||
Windows program version from the command line?
Todd wrote:
On 12/19/2014 08:06 PM, Paul in Houston TX wrote: Todd wrote: Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) ver $ ver privatefirewall-7.0.30.3.exe Microsoft Windows XP [Version 5.1.2600] Huh. "ver" is giving me the version of Windows, not the program. Rats! Ah... sorry, thought you meant Windows itself. |
#9
|
|||
|
|||
Windows program version from the command line?
On 12/19/2014 11:44 PM, Paul in Houston TX wrote:
Todd wrote: On 12/19/2014 08:06 PM, Paul in Houston TX wrote: Todd wrote: Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) ver $ ver privatefirewall-7.0.30.3.exe Microsoft Windows XP [Version 5.1.2600] Huh. "ver" is giving me the version of Windows, not the program. Rats! Ah... sorry, thought you meant Windows itself. No problem. I think it was an easy mistake to make. |
#10
|
|||
|
|||
Windows program version from the command line?
Todd wrote:
Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) I approached the problem this way. First, find an article that talks about the data structure in the header of executable files. http://www.delphidabbler.com/articles?article=20 Then, take one of the parameters, combine it with "vbscript", and see if anyone has written a script for it. dwFileVersionMS vbscript That gets me to a page like this. http://stackoverflow.com/questions/6...ws-dll-version OK, another. http://stackoverflow.com/questions/3...-in-powershell For some reason, not all of those commands in Powershell, produce output here. This would have been ideal, except you have to register to get the download. Showver.exe. http://www.codeproject.com/Articles/...-display-progr HTH, Paul |
#11
|
|||
|
|||
Windows program version from the command line?
"Todd" wrote in message
... Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) Do it in PowerShell: get-itemproperty -path c:\foobar.exe | format-list -property versioninfo Joe |
#12
|
|||
|
|||
Windows program version from the command line?
Joe Morris wrote:
"Todd" wrote in message ... Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) Do it in PowerShell: get-itemproperty -path c:\foobar.exe | format-list -property versioninfo Joe OK, I got this one to work, in Powershell. [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Windows\notepad.exe") | format-list Paul |
#13
|
|||
|
|||
Windows program version from the command line?
| This would have been ideal, except you have to register | to get the download. Showver.exe. | | http://www.codeproject.com/Articles/...-display-progr | I've written a script to do that: http://www.jsware.net/jsware/scrfiles.php5#fvinfo The script provided is a demo of a VBScript class that uses binary operations through FileSystemObject to extract and parse the VersionInfo section of PE files. PE files (portable executable, such as EXE, DLL, OCX) are structured in a complex design that involves a kind of index at the beginning of the file, which contains data about the offest into the file of various sections that can be in a PE file, such as executable data, import table, export table, etc. VersionInfo is one of those sections. The Win32 API includes functions to get version info, but VBS can't call Win32 API functions. By parsing the actual bytes of the file that requirement is bypassed, allowing the script to do what version.dll would have done. (Due to limitations with FileSystemObject functions, the script will not work properly on systems with the language set to a DBCS language - Chinese, Japanese, or Korean, but it should work fine on any other Windows computer from Win98 up.) Another limitation: This script deals with 32-bit executables. I haven't tested it with 64-bit executables. A 64-bit PE file may have a different structure. It will definitely contain some differences. For instance, the pointer data that indicates the offset into the file of the VersionInfo section will be 4 bytes in a 32-bit PE file, but 8 bytes in a 64-bit PE file. So the script may fail when trying to extract VersionInfo from a 64-bit executable because it's assuming a structure based on 4-byte-centric data storage. A bit of editing might be in order, depending on what one actually wants. As written this script shows a long list of file properties in a msgbox window. There's also a method that uses Shell.Application, which involves getting a shell Folder object for the folder containing a file and then calling the GetDetailsOf method. But that method is not feasible in a console window and it's convoluted to do in a VBScript. Worse, the file properties returned in GetDetailsOf have been changed with each Windows version. Microsoft has all but broken the functionality of the method. I have to wonder why someone is trying to find file versions in a console window... or why someone is doing anything in a console window at all that doesn't have to be done there. It seems beyond absurd to me to type a long a command line to run a script, with the path of the file in question as a parameter, when one could simply drop that file onto the script. |
#14
|
|||
|
|||
Windows program version from the command line?
I realized I overlooked the simplest script approach:
Dim FSO Set FSO = CreateObject("Scripting.FileSystemObject") MsgBox FSO.GetFileVersion("C:\windows\notepad.exe") Set FSO = Nothing It won't return product version, but those are usually the same thing. The PowerShell approach looks like it makes much more sense for console, though. That's what PS is designed for. VBS was designed for Windows GUI. |
#15
|
|||
|
|||
Windows program version from the command line?
On 12/20/2014 05:19 AM, Paul wrote:
Joe Morris wrote: "Todd" wrote in message ... Any of you guys know how to read the version of a Windows program from the command line? (The same version you get from Windows Explorer by right clicking on the program and selecting properties.) Do it in PowerShell: get-itemproperty -path c:\foobar.exe | format-list -property versioninfo Joe OK, I got this one to work, in Powershell. [System.Diagnostics.FileVersionInfo]::GetVersionInfo("C:\Windows\notepad.exe") | format-list Paul Thank you guys! |
|
Thread Tools | |
Display Modes | Rate This Thread |
|
|