i am using rmdir to delete directories but it does not seem to work when there is something in the directory
any easy ways to fix this?
Printable View
i am using rmdir to delete directories but it does not seem to work when there is something in the directory
any easy ways to fix this?
delete all the files and subdirectories first.
though maybe FSO can do it
pete
in a shell, RmDir C:\Hello /s /q will remove a directory even if it isnt empty.
He means to do this:
VB Code:
Option Explicit Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Private Const SW_SHOWNORMAL As Long = 1 Private Const SW_HIDE As Long = 0 Private Sub Command1_Click() ShellExecute Me.hwnd, "Open", "C:\Windows\System32\CMD.exe", " /c RMdir c:Hello /s /q"", "C:\", SW_SHOWNORMAL End Sub
VB Code:
Kill [dir] & "\*.*" RmDir [dir]