Windows 10: Why does Windows return access denied when trying to touch a file being deleted

Discus and support Why does Windows return access denied when trying to touch a file being deleted in Windows 10 Software and Apps to solve the problem; Apologies if the topic has already been beaten to death but I couldn't find a discussion.Trying to access a file with WCreateFile or WGetFileAttributes... Discussion in 'Windows 10 Software and Apps' started by Jeffrey_i, Jan 20, 2022.

  1. Jeffrey_i Win User

    Why does Windows return access denied when trying to touch a file being deleted


    Apologies if the topic has already been beaten to death but I couldn't find a discussion.Trying to access a file with WCreateFile or WGetFileAttributes while the file is the target of a WDeleteFile call results in ERROR_ACCESS_DENIED 5 from GetLastError. The NTSTATUS error code from RtlGetLastNtStatus is STATUS_DELETE_PENDING 0xC0000056.My issues are:1. Why doesn't GetLastError return ERROR_DELETE_PENDING 303 rather than ERROR_ACCESS_DENIED? Clearly somewhere in the code the cause of the trouble is known and GetLastError has an error code for this situation so why isn't it used?2.

    :)
     
    Jeffrey_i, Jan 20, 2022
    #1
  2. Polterry Win User

    Denied Access to delete files

    Thanks for suggestions. I tried AVG Remover but it found nothing; probably because I had already deleted the bulk of the files. I also tried Command and Safe Mode but both gave Denied message. So the question remains how do I get access to delete files? Would changing to MS login at Start help?
     
    Polterry, Jan 20, 2022
    #2
  3. AJWtechit Win User
    Recycle Bin - Deleting an item returning 'Folder Access Denied'

    Hi,

    I am trying to delete a file from one of my user's PC's and I keep getting the below message returned:


    Why does Windows return access denied when trying to touch a file being deleted [​IMG]


    I have referenced this thread already -> Recycle Bin Corrupted - Cannot Delete File or Folder

    Method 1 returns no results - when I actually navigate to c:\$recycle.bin it shows as empty, and there are no other drives I cannot locate the file in (show hidden files is selected)
    Method 2 - I cannot see the hidden $recycle.bin folder in the C drive with hidden files ticked on.

    What I have tried:
    - I have tried running the recycle bin as an administrator
    - Tried running cmd as admin to clear the recycle bin
    - Tried running CCleaner to clear the recycle bin
    - Tried restoring the file in question (won't restore)

    Anyone have any other suggestions?

    Thankyou!
     
    AJWtechit, Jan 20, 2022
    #3
  4. Bree Win User

    Why does Windows return access denied when trying to touch a file being deleted

    [Question] Delete files with denied access with batch scripts

    'Access denied' may be because the file is open. Another cause of 'access denied' can be ownership and/or permissions. If it is permissions, try running the script as administrator.

    By the way, you don't put a space between the '/' and the option letter, and the /A option on its own like that does nothing. It is for selecting files by attribute and should be followed by a colon and list of attributes, eg. /A:RSH

    The SYSTAG.BIN file is usually created by Aomei Backupper and that may have the file open.

    what is systag.bin? — AOMEI Forum
     
Thema:

Why does Windows return access denied when trying to touch a file being deleted

Loading...
  1. Why does Windows return access denied when trying to touch a file being deleted - Similar Threads - Why does return

  2. how to delete a file if access is denied

    in Windows 10 Gaming
    how to delete a file if access is denied: how to delete a file if access is denied. im updating my pc for 24hr and i get a error message. the solutin for the error message is to delete a folder in this location "C:\Windows\System32\DriverStore\FileRepository\vbvoicemeetervaio64_win10.inf_amd64_c2bd37de84fa6e4f".so...
  3. how to delete a file if access is denied

    in Windows 10 Software and Apps
    how to delete a file if access is denied: how to delete a file if access is denied. im updating my pc for 24hr and i get a error message. the solutin for the error message is to delete a folder in this location "C:\Windows\System32\DriverStore\FileRepository\vbvoicemeetervaio64_win10.inf_amd64_c2bd37de84fa6e4f".so...
  4. why is access being denied to my folders

    in Windows 10 Gaming
    why is access being denied to my folders: My Microsoft account was frozen because I got hacked, I now finally able to get into my account, but all my folders are denying me access. I can't actually get into any one of stuff...
  5. why is access being denied to my folders

    in Windows 10 Software and Apps
    why is access being denied to my folders: My Microsoft account was frozen because I got hacked, I now finally able to get into my account, but all my folders are denying me access. I can't actually get into any one of stuff...
  6. Why does Windows return access denied when trying to touch a file being deleted

    in Windows 10 Network and Sharing
    Why does Windows return access denied when trying to touch a file being deleted: Apologies if the topic has already been beaten to death but I couldn't find a discussion.Trying to access a file with WCreateFile or WGetFileAttributes while the file is the target of a WDeleteFile call results in ERROR_ACCESS_DENIED 5 from GetLastError. The NTSTATUS error...
  7. Why does Windows return access denied when trying to touch a file being deleted

    in Windows 10 Gaming
    Why does Windows return access denied when trying to touch a file being deleted: Apologies if the topic has already been beaten to death but I couldn't find a discussion.Trying to access a file with WCreateFile or WGetFileAttributes while the file is the target of a WDeleteFile call results in ERROR_ACCESS_DENIED 5 from GetLastError. The NTSTATUS error...
  8. Access denied when force deleting a file

    in Windows 10 Network and Sharing
    Access denied when force deleting a file: The previous owner of my windows 10 laptop fell for a scam? involving a free burning studio from disc-maker.net. The program causes a pop-up to be on my screen all the time, and the pop up won't go away. I traced the file down and attempted to delete it, but since it's...
  9. Denied Access to delete files

    in Windows 10 Support
    Denied Access to delete files: I am experiencing the infamous Blue Screen irregularly and I suspect from reading posts it is linked to AVG Internet Security product. I bought this but later canceled it and thought I had uninstalled it. However later I found that the uninstallation left a lot, if not all,...
  10. Recycle Bin - Deleting an item returning 'Folder Access Denied'

    in Windows 10 Support
    Recycle Bin - Deleting an item returning 'Folder Access Denied': Hi, I am trying to delete a file from one of my user's PC's and I keep getting the below message returned: [img] I have referenced this thread already -> Recycle Bin Corrupted - Cannot Delete File or Folder Method 1 returns no results - when I actually navigate...