The batch file contains commands that run the script and apply the export profile. Create the batch file in a text editor, such as Notepad.
The finished batch file looks like the following example (except for your replacements for file and folder names):
for %%f in (*.dwg) do (
"C:\Program Files\AutoCAD Map 3D 2023\acad.exe" %%f /b MyExport.scr
rename SDFs\Temp.sdf %%~nf.sdf
)
This exercise continues the process of batch-exporting from the previous exercise, Creating the Script File.
To create the batch file
for %%f in (*.dwg) do (
The variable %%f tells the batch file to iterate through the folder, selecting a new file each time. The expression (*.dwg) tells the batch file to look for files with the extension .dwg.
"C:\Program Files\AutoCAD Map 3D 2023\acad.exe" %%f /b MyExport.scr
If your version of AutoCAD Map 3D toolset is installed in a different folder, substitute that location for C:\Program Files\AutoCAD Map 3D 2023\acad.exe. Substitute the name of your script file for MyExport.scr.
rename SDFs\Temp.sdf %%~nf.sdf
Replace SDFs\Temp.sdf with the location you specified in the script file.
Save the batch file in the same folder as the DWG files to export.
To continue this tutorial, go to Running the Batch File.