in a Windows cmd batch file (.bat), how do i pad a numeric value, so that a given value in the range 0..99 gets transformed to a string in the range \"00\" to \"99\". I.e. I
The single line
IF 1%Foo% LSS 100 SET Foo=0%Foo%
will get you what you want for numbers in the range that you specify. It does not change values in the subset 0-9 if they are already single-padded.