- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir /b /a-d *.dat') do (
- set "OldName=%%~ni"
- set "NewName=!OldName:.=_!"
- ren "%%i" "!NewName!%%~xi"
- )
复制代码
- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir /b /a-d *.dat') do (
- set "OldName=%%~ni"
- set "NewName=!OldName:.=!"
- ren "%%i" "!NewName!%%~xi"
- )
复制代码
|