How to move 'Program Files' and 'WindowsApps' folders

Anonymous
2024-08-27T15:14:15+00:00

I loosely followed an article on how to move the default download locations, and put them from my C drive to my D drive. Then I saw that that didn't really achieve what I wanted, so I put the settings back on C drive.

Now the 'Program Files' and 'WindowsApps' folders seem to be still on my D drive and I can't move or delete them (apparently lacking the SYSTEM permissions), neither can I open them to see what's inside.

I think the folders are probably from the mytra folder, but I have no clue. In the C drive, there still is a Program Files folder without WindowsApps folder inside if thats important.

I have tried the following commands in cmd run as Admin, but the 2nd one failed.

takeown /f D:\ /r /d y

icacls D:\ /grant administrators:F /T

Edit Solution:
Downloaded Right-Click Tools (link in replies) which gave me a TakeOwn option. After using that I could look inside the folders (all empty) and delete them (select + delete key).

Windows for home | Windows 11 | Files, folders, and storage

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2024-08-28T13:11:15+00:00

    Edit Solution:
    Right-Click Tools had a TakeOwn option. After using that I could look inside the folders (all empty) and delete them (select + delete key).

    Ah, interesting. The Take ownership and get access option in Right-Click Tools uses the more powerful SetACL program. Good to know that worked in this case. By default, for your own protection, it wouldn't have allowed you to make that change on the WindowsApps on C: but a copy on D: is assumed to not be a system folder, so it will allow it.

    I think it would have also worked to to go straight to the rd command in the Cmd here as TrustedInstaller prompt.

    0 comments No comments
Answer accepted by question author
  1. Anonymous
    2024-08-27T21:23:16+00:00

    I installed your Right-Click Tools and ran the WindowsApps folder in cmd as TrustedInstaller and tried the icacls command provided by Dave, but I got the same message again.

    Don't try to change the permissions (i.e. don't run takeown or icacls). Just open Cmd here as TrustedInstaller and use the RD command. Assuming you want to remove the entire folder, enter this command:

    rd /s /q d:\windowsapps
    
    0 comments No comments
Answer accepted by question author
  1. Anonymous
    2024-08-27T16:36:25+00:00

    System folders have extra security to protect them from malware. The WindowsApps folder is protected with TrustedInstaller level access. You should not try to change permissions on system folders.

    To get everything working correctly again, you may have to reinstall Windows.

    Note: To access or change system folders you can use a tool that gives you TrustedInstaller access, such as PowerRunAdvancedRun, or my free Right-Click Tools.

    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Anonymous
    2024-08-27T16:50:54+00:00

    Hi, I am Dave, I will help you with this.

    1

    On your C drive, there should be a WindowsApps folder inside C:\Program Files, if oyu turn on Hidden folders you should find it.

    2

    The Program Files and WindowsApps folders on the D drive are created if you set new apps from the Store to be installed on that drive, and those folders are highly protected to ensure the Store Apps are malware free.

    Try running these commands to remove the WindowsApps folder from the D drive

    takeown /f D:\windowsapps /r

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

    rd D:\windowsapps /s /q

    0 comments No comments
  2. Anonymous
    2024-08-27T19:14:15+00:00

    Hi Dave, thanks for the quick answer!

    1 yes now the WindowsApps shows up in ProgramFiles.

    2 sadly the 2nd (icacls) command returns:

    administrators: No mapping between account names and security IDs was done.
    Successfully processed 0 files; Failed processing 1 files

    the next command of course then said access denied when I tried.

    In specific:

    D:\windowsapps\Deleted - Access is denied.

    D:\windowsapps\MutableBackup - Access is denied.
    Access is denied.

    0 comments No comments