2

I can't delete the folders that are created by Windows.

One day I switched the place to all new files from disk C to disk D. Then I immediately changed the place back, to disk C.

Windows managed to create a few folders and now I cant't delete them with any way from the Internet. I found similar questions here, but they were not about MY problem.

I don't have the access to delete these folders and any way I tried - and I tried pretty enough - didn't help. I was doing everything as it was said, but it didn't work.

The folders I want to delete are Program Files and WindowsApps. There used to be more folders I wanted to delete and I did following the steps from the Internet either without. The folders are empty and if I delete it nothing will change in my OS, as they don't weight even a byte and aren't used any time.

How can I get the access to delete them or is there any other way to do that? When I try to delete I see the message: "To delete this folder you need to have the administrator's rights". I tried to change the rights of some users, but it didn't help.

P.S. So what I tried: tried many things, so I tell only what I remember: 1. I tried some apps (for example IObit Unlocker, found it here https://answers.microsoft.com/ru-ru/windows/forum/all/%d0%ba%d0%b0%d0%ba/229a678b-a894-40b5-a1cb-0171a56ab9f5), tried to change the owner (worked not with all folders)... And I can not recollect more, sorry. Only these. In some cases it helped, in these it didn't.

6
  • 2
    For all the blog post drama of this post there is remarkably little detail. You need to specify what you tried & what happened when you did. "Switched the place" and "from the internet" gives us no clue about your actual predicament or what you have so far tried to solve it.
    – Tetsujin
    Commented Jul 6, 2022 at 15:48
  • I can't remember where I switched it. Ok, I shall edit the post.
    – Beholder
    Commented Jul 6, 2022 at 15:49
  • Changed. Sorry for only two details, I can't recollect more, did it long ago.
    – Beholder
    Commented Jul 6, 2022 at 15:55
  • Wow, I could, but not exactly in this way: on the third step the second command did not work, I don't know why. I tried to jump tu the third, but the commander returned me an error. Then I tried to delete this folder with my hands and, yes, it has worked! Don't you know if I can use the same solution to delete the second problematic folder, "Program Files"? Just I feel scared to do this to the second folder for it is not mentoined there. And could you answer not through a comment but an answer? I wanna mark yours. (i just dont know how to vote it)
    – Beholder
    Commented Jul 6, 2022 at 18:00

1 Answer 1

2

To delete the WindowsApps folder on the non-system (D:) drive, run these commands from admin Command Prompt:

takeown /f d:\windowsapps /r

icacls d:\windowsapps /grant administrators:F /t

rd d:\windowsapps /s /q

Src: Fix: Cannot Delete WindowsApps folder on Non-System Drives

You should be able to remove the Program Files folder on the non-system drive using the same way.

1
  • Thank you so much. It worked. And a remark for those who was mistaken like me: instead of "administrators:F" in the second command try to write <the path to your current user>:F. It may be obviously, but I just didn't get it at once, so...)
    – Beholder
    Commented Jul 7, 2022 at 7:55

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .