Comparing multiple file versions

All,

We’re finding that devices contain multiple files with versions above and versions below the version we are deploying for cleanup. Our cleanup version is “3006.0.1602.250.”

I was thinking of turning the versions into a string and may be tuple a comparison (tuple string item 0 of it < “3006.0.1602.250” …) but I will not know how many versions a device will have.

Example:
Q: ((versions of files “x.exe” of folders of folder “C:\x\x\x”) as string)
A: 2804.2900.1206.2900
A: 2900.0.1403.2800
A: 2913.100.1602.2501
A: 2913.100.1602.2500
A: 3018.0.1702.1600
A: 3006.0.1602.2600

This device would not need the cleanup version it because it has two versions higher than the cleanup version. Most devices are not as messy as this one. :slight_smile:

I’ve been doing much searching and cannot put together an answer. How can I compare each file version to my cleanup version and discern which device still needs the cleanup version of “3006.0.1602.250” ?

Is there a class one can recommend for writing relevance like this? Or is it just OJT?

Thanks in advance,

Jim Donlin

How about

exists files whose (name of it as lowercase ends with ".exe" AND version of it < "3006.0.1602.250") of folder "C:\X\X\X"

You should get a “True” if any file that is in the directory that ends with .exe matches.

1 Like

Too simple! :slight_smile:

Thanks Alan.

I’ve taken your suggestion and modified it a bit for these “fringe” devices that have higher and lower versions:

(exists files whose (name of it as lowercase is “x.exe” AND version of it < “3006.0.1602.250”) of folders of folder “C:\x\x\x”) AND (not exists files whose (name of it as lowercase is “x.exe” AND version of it > =“3006.0.1602.250”) of folders of folder “C:\x\x\x”)

So far testing is producing the expected results.

Using an (exists…) AND (exists…) should allow us to identify those endpoints that require additional cleanup.

Thanks again and Kind Regards,

Jim

1 Like

Just to nitpick, if the directory has a lot of files in it and you need to tune the efficiency, you should be able to use

(exists files "x.exe" whose (version of it < "3006.0.1602.250") of folders of folder "C:\x\x\x") AND (not exists files "x.exe" whose (version of it > ="3006.0.1602.250") of folders of folder "C:\x\x\x")

By calling out the filename specifically, the client doesn’t spend time looping through all the files that aren’t named “x.exe”.

1 Like