I need a code to rename one file after another with each run. I made a working code but it can be used only for limited amount of files. I would like it to be good for many many files (e.g. instead of copying if then command over and over again) Here is what I've got.
@ECHO OFF
set /p var1="<"ver.log (Had to use "" because otherwise it is hidden here)
set /a var1=%var1%+1
Echo "%var1%"> "%~dp0\ver.log"
If %var1% EQU 1 (
ren "%~dp0\chrom0.txt" 3.txt
ren "%~dp0\1.txt" chrom0.txt
)
If %var1% EQU 2 (
ren "%~dp0\chrom0.txt" 1.txt
ren "%~dp0\2.txt" chrom0.txt
)
If %var1% EQU 3 (
ren "%~dp0\chrom0.txt" 2.txt
ren "%~dp0\3.txt" chrom0.txt
@Echo "0"> "%~dp0\ver.log"
)
This works for 3 files. I can make it work for more but it is nonsense to use it for 50 or more files.
Please, help.