Use the Script feature to generate script files. Several options are available from the Generate Script dialog box.
Use AMANALYSEDWG to analyze a current drawing, which can then be used as the basis for generating a conversion file. Use AMCONVDWG to convert a current drawing. Use AMSCRIPT to convert a selected set of drawings.
A simple example is used here to demonstrate how to generate a script file for converting DXF drawing files to DWG drawing files.