There's one other thing that you may have to watch out for, depending on the speed of your network and PC.
Sometimes, the interfacing with the Windows File System that vl-file-delete does takes longer to occur than VLISP allows for on its own. Another way to put that is that your code is running too fast. It goes onto the next step before the file deletion actually takes place. Therefore you may get an error, or worse, unexpected results.
My suggestion is to wrap the vl-file-delete in a while loop that will keep testing for the deletion (non-existence) of the file before continuing on. Much like the following:
(defun c:filestore (/ doc fn dn nn count)
(vl-load-com)
(setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
(setq
fn (vlax-get-property doc 'FullName)
dn (vlax-get-property doc 'Name)
nn (strcase (strcat "h:\\" (substr dn 1 2) "\\" (substr dn 1 5) "\\" dn)
count 0
)
)
(if (findfile nn) ;; if the file already exists <-- notice the if statement
(progn
(vl-file-delete nn)
(while (and (findfile nn) (< count 100)) ;; <-- here's the loop
;; if the file is still to be found, hold on and try again...
(setq count (1+ count))
)
)
)
(vl-file-copy fn nn)
(prompt "File Stored... ")
(princ)
)
But that's just my final 2 cents worth...