Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

How to? Compare executables' version/build # including 123.456.789.01

Oct
364
17
I have some executables that need to be updated each time Win 10 does a Spring/Fall update.

I'm wondering if there is an easy way to compare version numbers for a "greater than", "less than" approach. I'm not talking about version numbers in the sense of Win 8 and Win 8.1, and I'm not thinking of a particular product (e.g., Windows or TCMD).

For instance, on this PC echo %@verinfo[%windir\explorer.exe] produces:
10.0.17763.1 (WinBuild.160101.0800) [which is Oct 2018, ver 1809]

The version that had to be replaced has:
10.0.17134.165 (WinBuild.160101.0800) [which is Apr 2018, ver 1803]

Note that--as is common with version number schemes--there is more than one period in the version number, so a simple numeric comparison won't work.

I do realize the number can be parsed into fields and then the individual fields can be compared. But I'm wondering if there is a simpler way.

Or maybe TCC could add an @VERCOMP[path1,path2] function that returns Newer, Same, or Older (probably 1 for "file 1 is newer build, 0 for "same build", -1 for "file 1 is older build")
 
By the way, the reason I need it is this:

I need to have multiple icons on the taskbar that each open a different folder in File Explorer. Windows doesn't allow that because it sees those all as File Explorer.

Even if you put separate links directly in C:\Users\{username}\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar Windows won't display them.

I create a C:\Program Files\Taskbar-Duplicates\ folder and have renamed copies of explorer.exe there. Windows sees those as different programs and shows them separately in the taskbar.

The problem is that each time MS updates explorer.exe none of those work, so I have to copy and rename all again. I know to do that, but for those with no technical background it would be easier to tell them, "If these icons ... have stopped working, run this .btm file and try again," and the file checks and re-copies if necessary.
 
It doesn't take much of a BTM (or library routine) to do that. Here's a very skimpy one (which doesn't handle surprises).
Code:
setlocal
set rv=0
do i=0 to 3
    set a=%@word[".",%i,%1]
    set b=%@word[".",%i,%2]
    if %a LT %b (set rv=-1 & leave)
    if %a GT %b (set rv=1 & leave)
enddo
echo %rv
quit %rv
 
Just the link in the text. (Which does not in fact point to the function I intended. But it seems it was close enough for Rick to find the right one.)

I didn't see the link in the text. Wonder if i can chage the colors so it makes links different then reg. text.
 
I didn't see the link in the text. Wonder if i can chage the colors so it makes links different then reg. text.

Here, using Chrome, they're blue (regular text is black by default.) And that specific link is boldface. Does it really look the same on your system? Are you using some unusual browser?
 
I'm planning on doing something that will read in a list of files and do a "compare this with that and if that is newer, copy it to this."
 
Here, using Chrome, they're blue (regular text is black by default.) And that specific link is boldface. Does it really look the same on your system? Are you using some unusual browser?

Yes - the text and link appear the same color. I can barely tell the link is boldface. Using FF 65.0b9 (64-bit)
 

Similar threads

Back
Top