So, I have a simple batch program, but I'm having trouble with some code. Let's say I have this:
set %expdir%=C:GameDeployment
echo Enter Export Number, or Enter X for Automatic
set /p basenumb="Number: "
if "%basenumb%"=="x" ( goto foo ) else ( goto bar )
:foo
rem //Calculate Biggest Number Here
set /a numb=%calc%+1
:bar
set numb=%basenumb%
What I want to do is in the part where the comment is located, run through all the directories in expdir and calculate the one that has the biggest number for a name, excluding anything that has letters, and set the name of the directory as the variable calc
So, if I have the following folders in C:GameDeployment:
- 1
- 10
- 19
- 21
- 45
- 137
It should set calc to 137 since 137 is the biggest number in the directory list. Only problem is I don't know of any commands to pull this off.
