Here is some code to open the dwg folder from withing autocad, you may need to rename the command since autocad
natively uses the same name. Here is the code a real gem.
;; exp.lsp
;;
;; Launches Microsoft Windows Explorer from the current drawing directory.
;; Library Functions Used
;; NONE
;;
;;*************************************************************************************************
;;*************************************************************************************************
;;
(defun c:exp ( / cmdecho_old error_old expert_old)
;;
;;*************************************************************************************************
;;
;; Define Error Trap Function - DO NOT EDIT!!!
;;
(defun-q func_err (err)
(setq err_list (list "Function cancelled"
"quit / exit abort"
"console break"
)
)
(if (not (member err err_list))
(princ (strcat "\nError: " err))
)
(setvar "CMDECHO" cmdecho_old)
(setvar "EXPERT" expert_old)
(setq *error* error_old)
(princ)
)
(setq cmdecho_old (getvar "CMDECHO")
expert_old (getvar "EXPERT")
error_old *error*
*error* func_err
)
(setvar "CMDECHO" 0)
(setvar "EXPERT" 1)
;;
;;*************************************************************************************************
;;
;; Define Subroutines
;;
;;*************************************************************************************************
;;
;; Main Code Section
;;
(startapp "EXPLORER" (strcat "/n,/e," (getvar "DWGPREFIX")))
;;
;;*************************************************************************************************
;;
;;Restore variables for FUNC_ERR - DO NOT EDIT!!!
;;
(setvar "CMDECHO" cmdecho_old)
(setvar "EXPERT" expert_old)
(setq *error* error_old)
(princ)
)
;;
;;*************************************************************************************************
;;*************************************************************************************************
another gem to delete layerfilters from Robert Bell, the code :
;|
;Written by: R. Robert Bell
;Purpose: Allows the user to enter a wildcard string to keep any matching filters.
;Sample string: "`#*,MW*" will keep all filters beginning with a "#" or "MW"
;Copyright © 2004 by R. Robert Bell
|;
(defun rrbI:LayerFiltersDelete (strKeepWC / objXDict)
;; This function insures that an Extension Dictionary exists, and works on both locations for layer filters
(vl-load-com) ; load ActiveX if needed
(vl-catch-all-apply ; trap error if no extension dictionary
(function
(lambda ()
(setq objXDict (vla-GetExtensionDictionary ; bind dictionary to variable
(vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object))))))))
(cond (objXDict ; if the extension dictionary exists
(or ; use OR to return T for success
(rrbI:DeleteAllXRecs objXDict "ACAD_LAYERFILTERS" strKeepWC) ; pre-2005 layer filters
(rrbI:DeleteAllXRecs objXDict "AcLyDictionary" strKeepWC))))) ; 2005 layer filters
(defun rrbI:DeleteAllXRecs (objXDict dictName strKeepWC / objDict i)
;; This function performs the chore of deleting each filer that doesn't match the wildcard
(vl-catch-all-apply ; trap errors
(function
(lambda ()
(setq objDict (vla-Item objXDict dictName)) ; get layer filters dictionary
(vlax-for objXRec objDict ; loop thru all XRecords in the dictionary
(cond ((not (and strKeepWC (wcmatch (vla-Get-Name objXRec) strKeepWC))) ; if deleting all filters, or current doesn't match wildcard
(setq i (1+ (cond (i) ; increment counter
(0)))) ; initialize counter
(vla-Delete objXRec))))))) ; delete filter
(cond (i (princ (strcat "\n" (itoa i) " filters deleted."))))) ; if counter is bound, report number of filters deleted
(defun C:LFD (/ inpKeep)
;; Main command-line function
(setq inpKeep (getstring
"\nWildcard mask for filters to keep, or <Enter> to delete all: "))
(rrbI:LayerFiltersDelete (cond ((/= inpKeep "") inpKeep))) ; pass nil to subr if user hit <Enter>
(princ)) ; clean exit
It is related so I hope it helps.