How can I delete these folders?


  1. Posts : 2
    Windows 10
       #1

    How can I delete these folders?


    How can I delete these folders?-screenshot-2021-12-02-104620.png

    Hi all,

    I accidentally installed some GamePass games on the wrong hard drive, and I have since uninstalled them, but these folders remain. They don't seem to have anything inside, but I can't just delete them from Explorer. I need permissions from TrustedInstaller and SYSTEM.

    Is there a way to force these to be deleted?
    Is it even safe to do so?

    Thank you!

    Windows 10, 21H2
      My Computer

  2. MaloK's Avatar
    Posts : 1,438
    Windows 7 Pro
       #2

    Hi,

    If you uninstalled the program from the right place you can delete those folders

    in an admin cmd prompt:
    Code:
    takeown /F "D:\Program Files" /A /R /D Y 
    icacls "D:\Program Files" /T /grant administrators:F 
    rd /s /q "D:\Program Files"
    
    takeown /F "D:\WindowsApps" /A /R /D Y 
    icacls "D:\WindowsApps" /T /grant administrators:F 
    rd /s /q "D:\WindowsApps"
    This will get rid of them
      My Computers

  3. dalchina's Avatar
    Posts : 34,237
    Win 10 Pro (1903) (2nd PC is 21H2)
       #3

    No need to trouble with taking ownership.

    You can boot your PC to a command prompt or from a live boot disk, or install e.g. Emco Unlockit (free, excellent) which will let you select files or folders and if necessary schedule them for deletion on restart.
      My Computers


  4. Posts : 2
    Windows 10
    Thread Starter
       #4

    MaloK said:
    Hi,

    If you uninstalled the program from the right place you can delete those folders

    in an admin cmd prompt:
    Code:
    takeown /F "D:\Program Files" /A /R /D Y 
    icacls "D:\Program Files" /T /grant administrators:F 
    rd /s /q "D:\Program Files"
    
    takeown /F "D:\WindowsApps" /A /R /D Y 
    icacls "D:\WindowsApps" /T /grant administrators:F 
    rd /s /q "D:\WindowsApps"
    This will get rid of them
    So if they appear as "0 bytes" in explorer, I'm definitely okay to delete using this method?
      My Computer

  5. MaloK's Avatar
    Posts : 1,438
    Windows 7 Pro
       #5

    ParkerFB said:
    So if they appear as "0 bytes" in explorer, I'm definitely okay to delete using this method?
    Yes no problem.
      My Computers


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 20:25.
Find Us




Windows 10 Forums