| View previous topic :: View next topic |
| Author |
Message |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Fri Nov 09, 2007 5:48 pm Post subject: |
|
|
Thanks for the help guys.
Now I need to know how to delete a folder? RemDir doesnt work, and Kill seems only to be for files. Any idea?
Something like
Kill ( App.Path & "\Test\" ) ' Gives runtime error 53 - File not found.
RemDir ( App.Path & "\Test\" ) ' Doesnt work
EDIT: RemDir doesnt work because the folder is non-writeable. or how you say it.
|
|
| Back to top |
|
 |
Pseudo Xero I post too much
Reputation: 0
Joined: 16 Feb 2007 Posts: 2607
|
Posted: Fri Nov 09, 2007 5:56 pm Post subject: |
|
|
| Moller wrote: | Thanks for the help guys.
Now I need to know how to delete a folder? RemDir doesnt work, and Kill seems only to be for files. Any idea?
Something like
Kill ( App.Path & "\Test\" ) ' Gives runtime error 53 - File not found.
RemDir ( App.Path & "\Test\" ) ' Doesnt work
EDIT: RemDir doesnt work because the folder is non-writeable. or how you say it. |
| Code: | Kill("C:\Test\*.*")
RmDir("C:\Test") |
_________________
| haxory' wrote: | can't VB do anything??
windows is programmed using VB right? correct me if im wrong.
so all things in windows you have like the start menu is a windows form too. |
|
|
| Back to top |
|
 |
atom0s Moderator
Reputation: 205
Joined: 25 Jan 2006 Posts: 8587 Location: 127.0.0.1
|
Posted: Fri Nov 09, 2007 6:03 pm Post subject: |
|
|
| Moller wrote: | Thanks for the help guys.
Now I need to know how to delete a folder? RemDir doesnt work, and Kill seems only to be for files. Any idea?
Something like
Kill ( App.Path & "\Test\" ) ' Gives runtime error 53 - File not found.
RemDir ( App.Path & "\Test\" ) ' Doesnt work
EDIT: RemDir doesnt work because the folder is non-writeable. or how you say it. |
You can use the script runtime library and the FSO (FileSystemObject) model to delete folders and other various file/folder functions.
To use it, first add the Microsoft Scripting Runtime to your project by going to:
Project -> References, and tick Microsoft Scripting Runtime
Next, an example to delete a folder, and everything in in:
| Code: | Private Sub Command1_Click()
Dim fso As New FileSystemObject
fso.DeleteFolder App.Path & "\folder", True
Set fso = Nothing
End Sub |
_________________
- Retired. |
|
| Back to top |
|
 |
NothingToShow Grandmaster Cheater Supreme
Reputation: 0
Joined: 11 Jul 2007 Posts: 1579
|
Posted: Sat Nov 10, 2007 2:23 am Post subject: |
|
|
Oh thanks. Ill try them both out!
EDIT: Only seemed to work with the one Wicaan told me.
|
|
| Back to top |
|
 |
|