Link to home
Start Free TrialLog in
Avatar of charvett
charvettFlag for United States of America

asked on

FOR /F Syntax in a batch file

I'm trying to figure out the correct  syntax for:

FOR /f "tokens=1,2,3,4 delims=." %a in ('dir /a-d /b access.abc.*') do echo ren "%a.%b.%c.%d" "%a.%c.%d"

Works fine from the command line but not within a batch file.

Thanks!

Avatar of Harisha M G
Harisha M G
Flag of India image

Hi charvett, replace % with %%

---
Harish
ASKER CERTIFIED SOLUTION
Avatar of Harisha M G
Harisha M G
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial