I first used FOR to rename .EXE to .EXE.BAK
@echo off
set pth=%cd%
for /r "%pth%" %%a in (*.EXE) do move /y "%%a" "%%a.BAK"
Later I wanted to try changing them back, but I don't know what's wrong with the statement below. I kept looking it over again and again, but it's still not right.
@echo off
set pth=%cd%
for /r "%pth%" %%a in (*.BAK) do (
set file=%%a
move /y "%%a" "%file:~0,-4%"
)
Could some expert give me some pointers?
@echo off
set pth=%cd%
for /r "%pth%" %%a in (*.EXE) do move /y "%%a" "%%a.BAK"
Later I wanted to try changing them back, but I don't know what's wrong with the statement below. I kept looking it over again and again, but it's still not right.
@echo off
set pth=%cd%
for /r "%pth%" %%a in (*.BAK) do (
set file=%%a
move /y "%%a" "%file:~0,-4%"
)
Could some expert give me some pointers?


