Hi aboodhamdi, My name is Jeremy, a Windows Independent Adviser. I'll be happy to help you out today. Let’s see what I can do.
*The first method to resolve "Access Denied" problems when deleting a folder is to delete the folder from Windows Safe Mode. To do that:
- Simultaneously press the Windows + R keys to open the 'Run' command box.
- In the run command box, type msconfig press Enter to open the System Configuration utility.
- At the Boot tab, check the Safe Boot option and hit OK.
- At the next window, click Restart.
- In Windows Safe Mode, try to delete the folder/file.
- Then, open the System Configuration utility (msconfig) utility again and uncheck the Safe Boot option. Hit OK to restart Windows normally.
*If that didn't work, another method to bypass the "You need permission" problem, is to change the Owner of the folder. To do that:
- Right-click at the folder or file that you cannot delete and select Properties.
- Select the Security tab and click Advanced.
- Click the Change Owner.
- Type your account username (e.g. "Admin") and click OK.
- Check the "Replace owner on subcontainers and objects" checkbox and click OK. Then click OK again to close security settings.
- Now try to delete the folder.
Or you may also try to delete the folder from Command Prompt.
- Open Command Prompt as Administrator.
- Take the ownership permissions for the folder that you want to delete, by typing this command:
takeown /F "Full_Path_Folder_Name" /r /d y
Sample: At this example we 're going to delete the "C:\Folder1", so the command will be:
takeown /F "C:\Folder1" /r /d y
- Then give this command to take full control permissions at the folder that you want to delete:
icacls "Full_Path_Folder_Name" /grant Administrators:F /t
Sample: For this example the command will be:
icacls "C:\Folder1" /grant Administrators:F /t
- Finally, type the following command to delete the folder:
rd "Full_Path_Folder_Name" /S /Q
Sample: For this example the command will be:
rd "C:\Folder1" /S /Q
Let me know how it goes
Kind regards,
Jeremy