im trying to rename some files but keep getting "system cannot find the file specified" while it does come up with the correct names in the driectory???
cd..
cd SFTPcomm
set count=0
for %%i in (clieop03.*) do (set name=%%i call :countadd)
:countadd
set /a count=count+1
ren "d:\sftpcomm\%name%" "d:\sftpcomm\r0003084.SFT.CLIEOP.A00%count%.TXT"
goto :eof
this is the output i get when dont set echo off
D:\SFTPcomm>rename.bat
D:\SFTPcomm>cd..
D:\>cd SFTPcomm
D:\SFTPcomm>set count=0
D:\SFTPcomm>for %i in (clieop03.*) do (set name=%i call :countadd )
D:\SFTPcomm>(set name=clieop03.b01 call :countadd )
D:\SFTPcomm>(set name=clieop03.b02 call :countadd )
D:\SFTPcomm>(set name=clieop03.i01 call :countadd )
D:\SFTPcomm>(set name=clieop03.i02 call :countadd )
D:\SFTPcomm>set /a count=count+1
D:\SFTPcomm>ren "d:\sftpcomm\clieop03.i02 call :countadd" "d:\sftpcomm\r0003084.
SFT.CLIEOP.A001.TXT"
The system cannot find the file specified.