|
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 extension
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 @ECHO OFF set c=0 set ifi=FOR,/F;"Tokens=1,2,3,4,5*",%%A;in, CLS;&%ifi%('dir /B'),do ( call set /a c=%%c%%+1 call rename %%A s_%%c%% )
this will rename all files in the current folder, to s_1 , s_2
|