Wednesday, June 1, 2016

Cleanup old and unused files associated with AutoCAD

AutoCAD/Civil 3D will create a number of files along the way. Some files log certain events and other files are left behind due to a crash or failure. I’ll often search these files then decide if they are needed. This can be a time consuming task depending on the amount of data and projects. Below is a list of AutoCAD files.

·         Plot.log (AutoCAD Plot Log File)
·         Acad.err (AutoCAD Error Log File)
·         sav*.tmp (AutoCAD Temporary Save File) In the event of a crash while saving a drawing, AutoCAD will leave the Temporary Save File in the same location as the DWG file.
·         *.adt (AutoCAD Audit Log File)
·         *.dwl & *.dwl2 (AutoCAD Drawing Lock Files) In the event of a crash, AutoCAD will leave Drawing Lock Files for unsaved drawings. Old drawings locks are usually overlooked because the file's attributes are set to hidden. Set the file manager to display “Hidden Files”.

The plot and audit log files can be turned off through the AutoCAD options and plot settings but make sure these files are not being utilized for company standards before doing so. Here are the system variables.
·         Audit Log Setting: "auditctl" "0".
·         Plot Log Setting: “-PLOTSTAMP” “Log File” “No” “Plot.Log”

Below is a simple batch command to automate the search and delete process. Copy and paste the script to a blank ASCI text file using Notepad then change the P: and P:\ (shown in red) to the desired drive and path. Save the file as AutoCAD File Cleanup.bat.
@echo on
cd\
P:
del "P:\acad.err" /s
del "P:\*.adt" /s
del "P:\*.dwl" /s /a
del "P:\*.dwl2" /s /a
del "P:\*.tmp" /s
del "P:\plot.log" /s
cd\

The batch file switches are as followed.
/s            Delete specified files from all subdirectories.
/a           Selects files to delete based on attributes.


Let me know if you have any questions.