Results 1 to 5 of 5

Thread: deleting un-empty directory

  1. #1

    Thread Starter
    Hyperactive Member notquitehere188's Avatar
    Join Date
    Dec 2004
    Posts
    403

    deleting un-empty directory

    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?
    It's not just Good, It's Good enough!



    Spelling Eludes Me

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: deleting un-empty directory

    delete all the files and subdirectories first.

    though maybe FSO can do it

    pete

  3. #3
    Banned ThaRubby's Avatar
    Join Date
    Apr 2005
    Location
    127.0.0.1
    Posts
    356

    Re: deleting un-empty directory

    in a shell, RmDir C:\Hello /s /q will remove a directory even if it isnt empty.

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901

    Re: deleting un-empty directory

    He means to do this:

    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
    4. ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long
    5.  
    6. Private Const SW_SHOWNORMAL As Long = 1
    7. Private Const SW_HIDE As Long = 0
    8.  
    9. Private Sub Command1_Click()
    10.     ShellExecute Me.hwnd, "Open", "C:\Windows\System32\CMD.exe", " /c RMdir  c:Hello  /s /q"", "C:\", SW_SHOWNORMAL
    11. End Sub
    Last edited by dglienna; Jun 11th, 2005 at 10:59 PM.

  5. #5
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: deleting un-empty directory

    VB Code:
    1. Kill [dir] & "\*.*"
    2. RmDir [dir]

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width