Here's my code :
set Installed_Folder_and_Executable=%Local_EXE:\=\\%
set Installed_Version=0
for /f "usebackq delims=, skip=2 tokens=2" %%A in (`wmic datafile where 'name^="%Installed_Folder_and_Executable%"' get Version /value /format:csv`) do set Installed_Version=%%A
::Removing dot from version number
set Trimmed_Version=%Version:.=%
set Trimmed_Installed_Version=%Installed_Version:.=%
::Reduce version number to 5 digits
set Trimmed_Version=%Trimmed_Version:~0,5%
set Trimmed_Installed_Version=%Trimmed_Installed_Version:~0,5%
The purpose of this is: we deploy software to our computers via .bat file and for the utility we need to verify the installed version versus the one we want to install. Everything was working until last week when Google Chrome release a 100.x.xxxx.xx version. Be cause of the way we treat the version number we get some troubles. the last version was 98.x.xxxx.xx, so during the treatment the two versions become 100xx and 98xxx, so it saw the previous version like if it was a more recent one than the 100's one. I was thinking about counting each digit in both variable and if one of them is shorter than add a zero in front of the shortest one.
Did anybody have an idea how to do that, I've tried many way without any result?