Results 1 to 4 of 4

Thread: Remove non-empty folders (Resolved)

  1. #1

    Thread Starter
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011

    Remove non-empty folders (Resolved)

    RmDir and Kill don't seem to work..
    No.. FSO and API please
    Last edited by moinkhan; Sep 20th, 2002 at 09:51 AM.

  2. #2
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    try this out

    VB Code:
    1. Private Sub Command1_Click()
    2.     On Error GoTo eh:
    3.    
    4.     Kill "c:\testing\*.*"
    5.     RmDir "c:\testing\"
    6.     Exit Sub
    7.    
    8. eh:
    9.     If Err.Number = 53 Then 'dir was empty
    10.         Resume Next
    11.     ElseIf Err.Number = 76 Then 'dir does not exist
    12.         MsgBox "DIR HAS ALREADY BEEN DELETED"
    13.     Else
    14.         MsgBox Err.Description & Err.Number
    15.     End If
    16. End Sub

  3. #3

    Thread Starter
    Frenzied Member moinkhan's Avatar
    Join Date
    Jun 2000
    Location
    Karachi, Pakistan
    Posts
    2,011
    Ah!!! Great!!
    Thankyou very much!!!
    so nice of you

  4. #4
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373
    always happy to help.. and actually write code that works

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