Permission problem when Deleting a Folder containi

Results 1 to 3 of 3

Thread: Permission problem when Deleting a Folder containi

  1. #1
    Join Date
    Dec 1969

    Default Permission problem when Deleting a Folder containi

    Hi all<BR><BR>I&#039;ve been trying to work this out now for a day or two. <BR><BR>I&#039;m using the FileSystemObject&#039;s DeleteFolder method to, as you might expect, delete folders. It all works fine ... except it seems to have problems deleting folders that contain files or subfolders. <BR><BR>Here&#039;s an extract of my code ... as you can see, I&#039;m looping through a form collection (delFldr), where each delFlder is the absolute path to the folder. An example of a delFlder value is ""<BR><BR>- - - - - -<BR><BR>If Request.Form("delFldr").Count Then<BR> For intLoop = 1 to Request.Form("delFldr").Count<BR> strSubFolder = Request.Form("delFldr")(intLoop)<BR> If objFSO.FolderExists (strSubFolder) Then<BR> On Error Resume Next<BR> objFSO.DeleteFolder strSubFolder, True<BR> Response.Write "&#060;p&#062;Error Source: " & err.source & "<BR>Error Description: " & err.description & "&#060;/p&#062;"<BR> End If<BR> Next<BR>End If<BR><BR>- - - - - -<BR><BR>The resulting output is:<BR><BR>Error Source: Microsoft VBScript runtime error<BR>Error Description: Permission denied<BR><BR>- - - - - - <BR><BR>Checking permissions reveals that everyone has read, write, delete, execute access to the folder.<BR><BR>Here&#039;s the wierd thing ... if the folder never contained any files or subfolders, the above code deletes it without a problem. But if it did contain files/subfolders, then I keep getting this error.<BR><BR>Anyone have any thoughts as to how to tackle this one?<BR><BR>Thanks,<BR>Graham

  2. #2
    Join Date
    Dec 1969

    Default RE: Permission problem when Deleting a Folder cont

    More information please:<BR>OS/WEBSERVER Type and Version<BR>If NT NTFS or FAT<BR>Are you dynamicaly creating the folders, files and subfolders?<BR>Have deleted all the sub items of the folder before deleting the folder?

  3. #3
    Join Date
    Dec 1969

    Default I've had the same problem before...

    I&#039;ve also had this problem, but it seems intermittant.<BR><BR>Sometimes it will quite happily delete a folder which contains documents, other times it will say permission denied. However, one strange thing I noticed was that it would delete the CONTENTS of the directory, but would get permission denied on the actual directory.<BR><BR>Again, it&#039;s only happened a couple of times before (therefore intermittant), on one of our Win 2000 systems (NTFS h/d, of course). There wasn&#039;t really a solution - I just kinda tried it again and it liked it.<BR><BR>Sorry... If anyone&#039;s found the reason it does this, pls post!<BR><BR>Craig.

Posting Permissions

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