setlocal enabledelayedexpansion
for /f %%i in ('dir/b *。 pdf’)do(
set /a n+= 1
Ren "%%i"! n! %%i "
)
If you need to sort according to certain rules, the above directory can be replaced by
Directory /b/od or directory /b/o-d is sorted by date.
Directory /b/on or directory /b/o-n is sorted by file name.
Sort by file size.