1.

Solve : Changing Files names in a sequentail order?

Answer»

I have 1000 files of different names, I want to change their names using a batch file to this way
s_0000,
s_0001,
.
.
.
s_0999, with any exteension

Note that all files in a folder called x and I want all files with the new names in a new folder called y

I did that code, but it changed the first file name only and the counter Z dose not increase

@echo off
SET DIR=X
set OUT=Y

set Z=000
for %%E in (%DIR%/*.*) do (
XCOPY %Dir%\%%E*.* %OUT%\s_%Z%.*
set /a Z=Z+1
)
pause
Google for "DELAYED EXPANSION", or search this forum.



Discussion

No Comment Found