I am wishing to rename files with a batch command and capture the original and renamed files in a list in order to provide a cross reference (doing a DIR /OS >file both before and after the batch file is not rigorous enough.
The file below carries out the renaming fine, but my understanding is not good enough to get the output bit working (if that is possible even!). Also the output in the example below is different depending on whether output is to file or screen.
Any help would be appreciated to increase my understanding of this.
--------------------------
@echo off
set /a c=%1
setLocal ENABLEDELAYEDEXPANSION
For %%G in (*.tif) do (
echo %%G >infile.txt
ren %%G abc.!c!.tif
set /a c=c+1
echo %%G >outfile.txt
)
endlocal
The file below carries out the renaming fine, but my understanding is not good enough to get the output bit working (if that is possible even!). Also the output in the example below is different depending on whether output is to file or screen.
Any help would be appreciated to increase my understanding of this.
--------------------------
@echo off
set /a c=%1
setLocal ENABLEDELAYEDEXPANSION
For %%G in (*.tif) do (
echo %%G >infile.txt
ren %%G abc.!c!.tif
set /a c=c+1
echo %%G >outfile.txt
)
endlocal