Sorting files by numerical order

后端 未结 2 780
小鲜肉
小鲜肉 2020-12-02 02:49

I have a batch that create shortcut based on the order of files, the problem is that when it comes to numbers he presents the following problem when passing the number 100.<

2条回答
  •  攒了一身酷
    2020-12-02 03:40

    After much searching, I found the hybrid JScript/batch utility called REPL.BAT the dbenham and got what I wanted, based on my code the script is:

    Del /q "Files\Files.ini">nul 2>&1
    
    for /f "tokens=2 delims=:" %%F in (
      'dir /b /a-d "%location-of-files%\*.*"^|Files\repl "^(\w+).*" "00000$1:$&" a^|Files\repl ".*(\d{5}:)" "$1"^|sort'
    ) do echo %%F >> Files\Files.ini
    

提交回复
热议问题