Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

DeleteDir Problem


2 replies to this topic

asrinivas

asrinivas
  • Full Members
  • 36 posts

Posted 01 November 2007 - 12:21

Hi,

My application is creating on temp folder.that folder is in readonly mode.
when i try to remove it using DeleteDir("c:\\temp",ALLCONTENTS), it is not removing the directory.
how can i remove the folder , even if it is readlny mode.Plesae tell me a solution urgently.


Regards,
A.Srinivas

Stefan Krueger

Stefan Krueger

    InstallSite.org

  • Administrators
  • 13,269 posts

Posted 02 November 2007 - 13:38

I don't know why you create the folder as read-only in the first place, but you can remove the read-only flag using SetFileInfo.

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 03 November 2007 - 02:18

Usually you can retrieve an error code that provides more information. Examples of failure are:

- The media does not allow removal (eg. the disk is a cd-rom)
- The folder is read-only, or the administrator set access rights preventing you to delete the folder.
- The folder is 'in use', eg. it is opened in an explorer, or the current directory of a command prompt.
- The folder is not empty and contains items that cannot be removed
- The folder is not empty and contains items that are in use, eg. a file is opened in another program

Not all apply to your situation (and the list is not complete anyway), but you've got to check the error code for more information. If the folder is not empty try deleting its contents first, maybe you can figure it out if you know which file cannot be removed.