Here's a slightly more compact version, that also checks the actual names of the subfolders looking for the one with the highest value. You may want to stick with the current approach but if not this is an option. It also uses a couple of PUSHD (CD) commands to reduce the wordiness of the code.
~bp