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.
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?
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.
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”.