for /r %%G in (*_abc.txt) do ren "%%~G" *_abc_xyz.txt
I keep getting this error: %%G was unexpected at this time.
FOR variables use a single % when run from the command line, and double %% when within a batch script.
So to run on the command line, you need:
for /r %G in (*_abc.txt) do ren "%G" *_abc_xyz.txt
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
2 years ago