5

How do I delete a subdirectory of AppData\Local\Packages? More generally, is there a way to actually get administrator access over my computer so I can delete or modify files whenever I need to?

I want to delete some subdirectories of my AppData\Local\Packages directory. When I try, I get a message that says I need permission from the user I'm already logged in as to perform the action. There's a "Try Again" button that just brings up the same message.

I've tried running Explorer as Administrator. I've tried running alternative file managers as Administrator. I've tried running a Command Prompt session as Administrator and using the del command. Nothing works.

enter image description here

0

3 Answers 3

1

This can be easily achieved by using "TakeOwnership" a command on the right-click menu which can be added via a simple registry edit. You can download a registry file which does it for you here.

Extract the archive, import the reg-file by double-clicking on it. Windows will inform you about the successful import of the file. Afterwards just right-click on the file and/or folder you want to take ownership of and chose "Take Ownership" from the right-click menu.

Depending on how many items you selected, a couple of command-line windows will pop up and assign ownership to all selected files with the selected folder. After this is done, you can easily delete any file or folder you have taken ownership of.

You could also go the Microsoft way by right-clicking a folder or file and adding your account to the permission list in the security options menu (properties --> security) and giving yourself full access, but the above way is a lot more hassle-free and a lot more convenient.

2
  • The same thing could be achieved from the Advanced Security Settings (Properties -> Security -> Advanced), but I'm already the owner of the directory and all of the files and subdirectories it contains. Applying .reg files without knowing and understanding exactly what they do is not something I ever do or recommend to anyone else. However, the takeown and icacls commands that the registry file uses are interesting commands to learn about.
    – Vince
    Commented Sep 7, 2015 at 22:10
  • "The same thing could be achieved..." - That's what I explained in the very last section already. Your ownership was apparently not assigned correctly. As for the reg-files, the content can easily be seen and understood, so what's the problem? Btw, TakeOwnership has been around since Windows Vista so it's hardly unsafe advice, especially considering the fact that it solely relies on native command line tools. You're welcome btw... Commented Sep 7, 2015 at 22:18
1

I had the same problem and I found the solution:

  1. Open the Command Prompt as Administrator.
  2. Run cd %userprofile% && rmdir /s /q AppData\Local\Packages.
-1

Apparently, I need to go into the subdirectories and delete files until I stop getting the message. After going several directories deeper and deleting files, I was able to go back up the directory tree and delete the directories I had made empty.

This isn't really a solution and, in my opinion, it highlights a deficiency in Windows file security, but it worked.

I'd still like to know if there's a better way.

3
  • This shouldn't be an answer, but rather an edit to your initial question. You also didn't really waste any time answering your own question only 20 minutes after dumping it here Commented Sep 7, 2015 at 22:20
  • It's a partial solution, but not the whole answer. Although I wasn't watching the clock, I did discover it after I typed the question.
    – Vince
    Commented Sep 9, 2015 at 1:11
  • Actually, all you describe is how you deleted files and folders you already had permission to, but your question is directed at those where you lack permission to do so. So this is not really an answer to your question at all, not even a partial one, even though you might feel like you achieved at least something. Also, your quick self-answer indicates a lack of proper research. Commented Sep 9, 2015 at 9:11

You must log in to answer this question.

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