Folder Remove Error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Demo1224
    Forum Member
    • Jul 2003
    • 9

    Folder Remove Error

    I am having an an error pop up everytime I try to set up a button to delete a folder on my computer. Here is what I am doing.
    1. I have created a button that will install some WAV files onto the users computer, by creating a folder and dropping the files into that folder.
    2. When the user is finished using the WAV files I have given them the option to delete all the WAV files in that folder by deleting the folder.
    3. The problem begins when I preview my project. All the files are dumped onto the computer just fine. When I click on the "delete" button, I get the following error:
    "Could not remove directory.
    The directory cannot be removed."

    Is there someone who can help me quickly?
  • Worm
    Indigo Rose Customer
    • Jul 2002
    • 3971

    #2
    Re: Folder Remove Error

    Are you removing the WAV files first? The folder cannot be removed until it is empty. You may also need to do a Application.Sleep for a sec or two after deleting the WAVs before removing the folder.

    Comment

    • Demo1224
      Forum Member
      • Jul 2003
      • 9

      #3
      Re: Folder Remove Error

      There are about 30-50 WAV files in there. Is they a way to remove all of the files at once?

      Comment

      • Worm
        Indigo Rose Customer
        • Jul 2002
        • 3971

        #4
        Re: Folder Remove Error

        Use File.Delete with wildcard *.*

        The trick will be to wait long enough before removing the Folder.

        Comment

        • Demo1224
          Forum Member
          • Jul 2003
          • 9

          #5
          Re: Folder Remove Error

          Would this be the correct path to put in for the File Delete option?
          C:\WINDOWS\Desktop\DHL_Tutorials\WebPortal\*.*

          Comment

          • Lorne
            Indigo Rose Staff Member
            • Feb 2001
            • 2729

            #6
            Re: Folder Remove Error

            Better to use this, in case the user's desktop folder is somewhere else (most of them will be, btw):

            %Desktop%\DHL_Tutorials\WebPortal\*.*
            --[[ Indigo Rose Software Developer ]]

            Comment

            • ovm
              Indigo Rose Customer
              • Oct 2002
              • 242

              #7
              Re: Folder Remove Error

              and when u use windows XP, be sure the folder is not open by any other program. Removing files from a folder "in use" is not possible in XP (and w2000).

              gr. Mario
              programming is very easy, just put the characters in the right order....

              Comment

              Working...
              X