Posted: Sat Sep 22, 2007 12:55 am Post subject: Vb6 Help How to Delete Folder
hello guys how can i delete folder i know how to delete files but i dont know how to delete folder
Please give me the code thanks
- jeremydd[/code] _________________
all people on cheat engine dosent have respect on me So i will never post or visit this forum again this people are no respect T_T
-jeremydd
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
Posted: Sat Sep 22, 2007 7:08 am Post subject:
You can also use the FileSystemObject to remove folders. (And do various other directory related things.)
You need to add the Microsoft Scripting Runtime to your project:
Project -> References and locate 'Microsoft Scripting Runtime' in the list. Then check the checkbox next to it and click ok.
Then your code will be something on the lines of:
Code:
Dim FSO As New FileSystemObject
If FSO.FolderExists(YOUR_FOLDER_PATH) Then
FSO.DeleteFolder YOUR_FOLDER_PATH, True
End If
Edit the code as needed, change the paths. And you can also remove the true from the DeleteFolder call if you do not wish for the function to force the delete. If you plan on giving people a program that deletes things, I suggest coding in a check to make sure they want to delete it.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You can download files in this forum