-
I need to delete a folder that has files in it and sub folders with files in them...etc...
How can I delete the parent folder and all the subfolders and files in it without deleting the individual files first?
------------------
Morgan
[email protected]
My Web Page
-
RmDir dir1
------------------
smalig
[email protected]
smalig.tripod.com
-
RmDir won't delete a directory with files in it...
This Directory has anywhere from 20-50 subdirectories in it each with countless files in them...
------------------
Morgan
[email protected]
My Web Page
-
Try the FileSystemObject, eg.
Code:
Dim oFSO As Object
Set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.DeleteFolder "C:\Test", True
------------------
Aaron Young
Analyst Programmer
[email protected]
[email protected]
-
Ah Ha!! I had tried:
oFSO.DeleteFolder "C:\Test"
But it didn't work...
Then I tried your
oFSO.DeleteFolder "C:\Test", True
and it worked...
Thanks!!!
------------------
Morgan
[email protected]
My Web Page
-
Yes, the second parameter indicates where the files or folders in that folder should be removed.
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
why not Kill(path) ?
that would work wouldnt it?
-
Sorry Howard, the kill is for single files only