Another way to skin that cat.
(defun arch:batchplot (file-list-exclude)
;; portions by Tim Willey
(if (setq dirpath (directory-dia "* Select folder of Drawings to process *"))
(progn
(setq dwglist (vl-remove file-list-exclude (vl-directory-files dirpath "*.dwg" 1)))
(setq scrfile (strcat dirpath "MyScript.scr"))
(setq ofil (open scrfile "W"))
(write-line "SDI 1" ofil)
(write-line (strcat "(setvar " (chr 34) "FILEDIA" (chr 34) " 0)") ofil)
(foreach dwg dwglist
(setq fullpath (strcat dirpath dwg))
(write-line (strcat "_.open " (chr 34) fullpath (chr 34)) ofil)
(write-line(strcat "(load " (chr 34) my_lisp_file (chr 34) ")") ofil)
(write-line ".qsave" ofil)
(write-line "_.close" ofil)
)
(write-line (strcat "(setvar " (chr 34) "FILEDIA" (chr 34) " 1)") ofil)
(write-line "SDI 0" ofil)
(write-line "\(alert \"Done!!\"\)" ofil)
(close ofil)
(command "_.script" scrfile)
)
)
(princ)
)
Gary, his routine skips over that drawing if you send that drawing name.
My version removes it from the list. But you have to supply the skip list of names.
The program call should not include the path, use this for both routines.
(arch:batchplot '("2436TB.dwg"))