File Deletion Problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: BlueFrog (bluefrog_at_hyper-typer.com)
Date: 02/16/05


Date: Wed, 16 Feb 2005 19:29:56 -0000

Hi all,

I'd appreciate some ideas on this as I've just spent the last 2 hours trying
to solve it to no avail.

I'm am building a web application which includes the functionality to upload
images which are then resized to two thumbnail sizes and the original file
is then deleted - works fine. In another part of this application I wish to
be able to delete these thumbnail files from a datalist using the
system.io.file.delete method in VB.NET but keep getting the error below when
I try to do so on my local development machine (XP Professional).

[UnauthorizedAccessException: Access to the path
"c:\inetpub\wwwroot\netcat\engine\gallery\images\" is denied.]
   System.IO.File.Delete(String path) +264

I have confirmed that the file path and file name being sent to the delete
method are correct.

Things I've tried to resolve this:
1. Gave the ASP.NET account full permissions on the folder
2. Gave the iusr_machinename account full permissions on the folder
3. Gave the everyone account full permissions on the folder.
(I have checked that these permissions are propegating down to the files in
the folder correctly.

I still get the same error. Disabled my virus software (AVAST), still no
success.

Tried impersonation by putting a web.config file in the folder with my login
details - no joy.

Anyone got any other ideas - this is driving me nuts.

One thing I did notice and I don't know if this has any importance but the
owner/creator account doesn't have any rights nor could I apply any.

Very Blue Frog



Relevant Pages

  • Re: For those of you who have disabled UAC while using user/admin, you dont have full admin rights &
    ... In Vista, an admin user doesn't have permissions to ... has the ability to take ownership and change permissions. ... all one has to do is add a second user account on the folder ...
    (microsoft.public.windows.vista.general)
  • Re: User Account lost when XP had to be reinstalled
    ... you can set XP Home permissions in Safe Mode. ... This is not your administrator account, ... >Open Explorer, go to Tools and Folder Options, on the ... >tab, click advanced, go to the Owner tab and select the ...
    (microsoft.public.windowsxp.accessibility)
  • Re: For those of you who have disabled UAC while using user/admin, you dont have full admin rights &
    ... In Vista, an admin user doesn't have permissions to do everything they did in previous verions of Windows, but still has the ability to take ownership and change permissions. ... Really, all one has to do is add a second user account on the folder or file and give full rights as like the Administrator group, which would be the User account of the user/admin that logs into the machine. ...
    (microsoft.public.windows.vista.general)
  • Re: For those of you who have disabled UAC while using user/admin, you dont have full admin rights &
    ... In Vista, an admin user doesn't have permissions to do everything they did in previous verions of Windows, but still has the ability to take ownership and change permissions. ... Really, all one has to do is add a second user account on the folder or file and give full rights as like the Administrator group, which would be the User account of the user/admin that logs into the machine. ...
    (microsoft.public.windows.vista.general)
  • Re: How to unlock the user account files in an previous Window XP
    ... > ownership and permissions supersede administrator rights. ... This is not your administrator account, ... > Open Explorer, go to Tools and Folder Options, on the view tab, scroll to ... > tab, click advanced, go to the Owner tab and select the user that was logged ...
    (microsoft.public.windowsxp.accessibility)