|
-
November 4th, 1999, 02:07 PM
#1
simple deltree question
i hope someone can help me out here,
i wrote this in an old batch file,
deltree/y c:\windows\tempor~1
how can i write that same thing in vb?
Thanks,
Ele
-
November 4th, 1999, 06:59 PM
#2
Re: simple deltree question
You have a couple of options:
You could run the same batch file via the Shell Command, eg.
Shell "BatchFile.bat"
You could use the Kill and RmDir Functions to Systematically Remove the Directory Structure.
Perhaps the easiest to implement would be to use the FileSystemObject from the Scripting Runtime Library, eg.
private Sub Command1_Click()
Dim oFSO as Object
set oFSO = CreateObject("Scripting.FileSystemObject")
oFSO.DeleteFolder "Directory Path Here"
set oFSO = nothing
End Sub
This Method will Remove the Specified Directory and any Files or Sub Directories there in.
Aaron Young
Analyst Programmer
[email protected]
[email protected]
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
|