@echo off
set mypath=C:\rem
for /f %%i in ('dir %mypath%\*.* /a /b') do (
ren %mypath%\%%i "%date:~0,4%%date:~5,2%%date:~8,2%_%%~nxi"
)
echo OK
pause>nul
可通过mypath来指定目录。
本文介绍如何通过脚本批量重命名指定目录下的所有文件,并使用当前日期进行重命名,方便文件管理。
@echo off
set mypath=C:\rem
for /f %%i in ('dir %mypath%\*.* /a /b') do (
ren %mypath%\%%i "%date:~0,4%%date:~5,2%%date:~8,2%_%%~nxi"
)
echo OK
pause>nul
可通过mypath来指定目录。

被折叠的 条评论
为什么被折叠?