Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a directory with a number of files in it. e.g. 1234.pdf 2234.pdf 3234.pdf and so on I want to change the file names on these file using a batch file that i can schedule over night. I want the files to read test-1234.pdf test-2234.pdf test-3234.pdf Can anyone help?
In the batch below replace My_Dir with the path you want
:: MYREN.BAT Usage: myren string
@echo off
if "%*"=="" (echo. no renaming string & goto :EOF)
pushd "My_Dir"
for /F "delims=" %%j in ('dir /B *.pdf') do ren "%%j" "%*-%%j"
popd
:: [End_Of_Batch]Example: myren test
Report Offensive Follow Up For Removal
![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |