You must save the open dwg file.
If the new folder is not created successfully, please check whether Express Tools is installed in cad.
(Derun? c:tes? (? /? & amptr 1? ff 1? ff2)
(setq? ff 1? " D:\ \ A "); Create folder
(if? (VXMAKEDIRECTORY? ff 1); If the establishment is successful
(program
(setq? & amptr 1? (getvar? " dwgname ")); Extract file name
(if? (setq? ff2? (findfile? & amptr 1)); If you find this file,
(vl-file-copy? ff2? (strcat? ff 1? "\\"? & amptr 1)); Copy files to a new folder.
)
)
)
(princ)
); The appload command loads autolisp, TES command and attachment download.