windows - Batch file name in .bat file listing the whole file path -
windows - Batch file name in .bat file listing the whole file path -
i saw multiple posts on topic asking question, , tried apply different solutions, cannot create work. have set of files xx_date.ext1 need alter xx_date_suf.ext2 in bulk. need list total directory path files located. trying dos .bat file. tried apply solution minor changes found in 1 of posts:
setlocal enabledelayedexpansion %%i in (<directory name here>\*) ( set filename=%%~ni ren "%%~i" "!filename:~0,5!%%~xi" ) endlocal no avail. know above solution changing 5 char in file name, not need count number of characters.just simple rename described above.
this work verbal explanation provided:
@echo off cd /d "c:\folder" %%a in (*.ext1) ren "%%a" "%%~na_suf.ext2" or this:
@echo off %%a in ("c:\folder\*.ext1") ren "%%a" "%%~na_suf.ext2" windows batch-file rename
Comments
Post a Comment