Batch File Mutiple File Editing

Mar 9, 2023
Reaction score
First post here and I need some help please.

My day job is draughting, I use AUTOCAD.
I need to modify 1000's of files performing the same change in each file.

The change in each file can be handled by using a script file within the program, this has been tested and works as needed.
Using various internet searches I came across a command line batch process using the 'FOR' command and some examples.
From here I generated my bat file:

@echo off
set "source=C:\Users\marco\Desktop\1342 CAM Proy\Planos\09 Integracion Ambiental"
set script="%~dp0..\SCRIPTS\NORMALIZACONFIG.scr"
FOR /f "delims=" %%f IN ('dir /b "%source%\*.dwg"') DO %accoreexe% /i "%source%\%%f" /s %script%

(note: NORMALIZACONFIG.scr is the script file which is run within AUTOCAD)

This has been tested and it works well.
So why do I need help??

Well this only works in folder 'C:\Users\marco\Desktop\1342 CAM Proy\Planos\09 Integracion Ambiental' however all sub folders are ignored.
Can anyone help me get this to work in sub folder as well as the route folder??

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question