I am trying to write a batch file to find the folder that has the largest number in its name.
i.e. I have 3 dummy folders with alphanumeric names in the directory
So it should find "Prod114000" for me. I'm trying to pull just the numbers part of the folder name so I can use GTR to compare - I am having troubles pulling the numbers part out of the batch variable (%%G) though because I can't manipulate it.
I suspect there is also some problem in the "set latestdir=%%G" statement too.
What I (only) have right now is this:
for /D %%G in ("Prod*") do if %%G GTR %latestdir:~4,10% set latestdir=%%G
Thanks for the help!