Re: RmDir command generates an error 75 - Path/File access error




"Michael C" <nospam@xxxxxxxxxx> wrote

How about letting Windows do what it knows how to do?
The command processor could do that job with very little hassle:

Private Sub RmDir(Path As String)
Dim cmd As String
Dim dos As String

dos = Environ$("COMSPEC")
cmd = "rmdir """ & Path & """ /s /q"
Shell dos & " /c " & cmd, vbHide

End Sub

Are you seriously suggesting opening a command prompt to do this?!?!?

You say that like its never been done before! Consider how much code you
would have to write to delete a directory tree, and then look again at the
three lines above. If I was Rick Rothstein, I would have put that in one
line of code.

One line of code to delete a directory, all of its subdirectories, and all of the
files in those directories. I'd say that's not a bad trade off.

In case you were not aware, the user would not see any difference.....

Also consider what people routinely add to their programs, just to get
a status bar, or progress bar:

COMCTL32.OCX 567K
CMD.EXE 232K


LFS


.



Relevant Pages