Possible Duplicate:
Random variable not changing in “for” loop in windows batch file
I have text file with list of files I want to rename. This is my code:
for /f %%i in (tmp.txt) do set script_name=%%i & ren %script_name% %script_name:~0,9%%num%%script_name:~15,9%.sql
But in second part it takes %script_name% only in the first iteration of the loop. So
ren %script_name% %script_name:~0,9%%num%%script_name:~15,9%.sql
always do the same.
Please help to fix that.