- @echo off
- cd /d "指定路径"
- for /f "tokens=1* delims=|" %%A in ('powershell -c "gci .\*\*|?{-not $_.PSIsContainer}|foreach{$newname=$_.CreationTime.tostring('yyyyMMddHHmmss')+$_.directory.name+'Result'+$_.extension;$_.fullname+'|'+$newname;}"') do (
- echo ren "%%A" "%%B"
- echo copy "%%~dpA%%B" "其他位置\"
- echo.
- )
- pause
- exit /b
复制代码
|