I have been using a script file (SCR) like this for many years:
_.OPEN
"C:/Temp/A001.dwg"
(load "_SCR_BatchExe") ; here you can do anything you want as long as it doesn't break the script
(if(=(getvar "DBMOD")0)(command "_.CLOSE")(command "_.CLOSE" "_Y"))
_.OPEN
"C:/Temp/A002.dwg"
(load "_SCR_BatchExe") ; here you can do anything you want as long as it doesn't break the script
(if(=(getvar "DBMOD")0)(command "_.CLOSE")(command "_.CLOSE" "_Y"))
... etc.
_.NEW
"C:/Temp/End.dwt"
(load "_SCR_BatchEnd"); reset variables etc.
(_SCR_BatchEnd nil); reset variables etc.
(alert "Elaborazione conclusa correttamente.")
(princ "\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-")