VB icon

A Delete All files in a Directory and then Delete the DIrectory A

Email
Submitted on: 1/23/2015 8:48:00 AM
By: David Stewart Williams (from psc cd)  
Level: Beginner
User Rating: By 23 Users
Compatibility: VB 6.0
Views: 882
 
     Code Deletes a File and Directory, Note YOu DOnt Have to Reference Ms Scripting Runtime Please Vote for me if this helps you out or if you think it is a good code!!!!! Thank you Sean For letting me know you don't Have to reference Ms Scripting
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
'**************************************
' Name: A Delete All files in a Directory and then Delete the DIrectory A
' Description:Code Deletes a File and Directory, Note YOu DOnt Have to Reference Ms Scripting Runtime Please Vote for me if this helps you out or if you think it is a good code!!!!! Thank you Sean For letting me know you don't Have to reference Ms Scripting
' By: David Stewart Williams (from psc cd)
'**************************************

'you can't just delete an exe with this by itself but it can delete an exe in a directory
'Please vote if you like this code!!
Public Sub DelAll(ByVal DirtoDelete As Variant)
Dim FSO, FS
Set FSO = CreateObject("Scripting.FileSystemObject")
FS = FSO.DeleteFolder(DirtoDelete, True)
End Sub
'so like
Private Sub Command1_Click()
Call delall("c:\") 
'that would delete the c:\ drive
End Sub
'if you need more help e-mail me at 
'exhibitworks@yahoo.com


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.