Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I have to rename all the files in a particular
folder. I am able to rename it only one file and
the other files gets ignored. Could some one
help me with the code ?FOR %%l in (D:\Test\*.*) do (SET
FNAME=%%~nxl) & call:rename:rename
ren %FNAME% test.%FNAME:~4%.txtThis does rename (remove existing prefix and
add a new prefix) for the first file in the folder
but how to continue the same process for the
rest of the files ?Could someone please let me know ...

Answered in programming using for /f which is OK for XP but NG for DOS.
There is no %%~N in DOS.
=====================================
If at first you don't succeed, you're about average.M2

![]() |
batch file
|
File Management program
|
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |