|
-
February 28th, 2000, 09:21 AM
#1
Deleting whole durectories...
Hi,
my app creates a directory and puts some subdirectories in it with some files. When the app exits I want to delete all the directories.
I looked at the kill and rmdir command, but kill can only be used on files and rmdir doesn't do subdirectories.
Anybody got any ideas?
Thanks
-
February 28th, 2000, 09:51 AM
#2
Re: Deleting whole durectories...
use the FileSystemobject
Dim fso
set fso = CreateObject("Scripting.FileSystemObject")
Dim filespec as string
filespec = "c:\schrott\test"
fso.DeleteFolder filespec, true
-
February 28th, 2000, 09:53 AM
#3
Re: Deleting whole durectories...
small improvement:
Dim fso as Scripting.FileSystemObject
set fso = new Scripting.FileSystemObject
Dim filespec as string
filespec = "c:\schrott\test"
fso.DeleteFolder filespec, true
use early binding: add a reference to "microsoft scripting runtime" to your vb project.
and yes, it does delete subfolders.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|