Indigo Rose Software

Professional Software Development Tools

 
+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007
    Posts
    37

    Cannot Delete Base Folder

    I am trying to delete a folder tree that I created under the Windows Common App Data folder. I am able to delete everything but the base folder.

    Anyone know how to overcome this problem?

  2. #2
    Join Date
    Apr 2006
    Posts
    127
    It probably still has hidden files within it. In Tools/Folder Options/View/Advanced Settings, check the 'show hidden files and folders' option.

  3. #3
    Join Date
    Jul 2007
    Posts
    37

    Not hidden folders

    Thanks for the idea but I have this turned on. In fact, the folder tree I created is under the ProgramData folder on Windows 7 which is all hidden. I can delete all the subfolders and their contents.

    One interesting thing is that I tried calling the Folder.DeleteTree function twice. The first time all the files are deleted but the folder and its subfolder are not removed. The error is "folder not empty". So then I have the app sleep for 2 seconds and call the function again and this time I get the "cannot delete base folder".

    Maybe this is a Windows 7 thing... I'll have to try it on XP and Vista to see if I get the same behavior.

  4. #4
    Join Date
    Apr 2006
    Posts
    127
    It could be a Windows bug, perhaps they are removed but remain displayed. I saw that once in early-version XP and it actually required a re-start for the folder display to be corrected.

    You could try sending a screen refresh, which is a Windows call, something like (C++):

    RedrawWindow(NULL,NULL,NULL,RDW_ERASE+RDW_INVALIDA TE+RDW_ALLCHILDREN+RDW_UPDATENOW)

    I think there is a WinAPI DLL for AMS mentioned elsewhere on the forum.

Posting Permissions

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