I'm trying to use a batch file to list files in a directory such that the file name only (minus extension) matches only numeric patterns, e.g. something like 125646543.pdf which would be easy to express as a regex [\d]+\.pdf but of course I don't have such niceties with Windows-only mechanisms... I'm trying to do this with Windows-only mechanisms since I cannot install anything else on the target servers, and it needs to be supported at least on Windows Server 2000 and 2003.
I'll take a specific solution for this particular example or something more generic that has something more advanced than just ye olde * and ?
I've already tried to work with set /a in order to add a number to the file name, but since it interprets strings as environment variables and 0's if they're not defined, this doesn't work well. I also tried using if %%~na GTR 0, but that matches text file names such as report.pdf as well, since it seems to do a string comparison in this case.