Windows 10: Can't delete Windows and all Program-files-files(x86)-data folders why Solved

  1.    22 Oct 2017 #1

    Can't delete Windows and all Program-files-files(x86)-data folders why


    In D: drive i have the old windows. I didn't uninstalled them i just installed new windows on C:
    The drive D: was C: but now the drives switched.

    Now in C: i have the new installed windows 10 and it's working fine.
    But on D: i have the old windows folder and also the folders: Program Files, Program Files(x86) and ProgramData

    And when i try to delete all this 4 folders i'm getting in each one of them a message:

    Click image for larger version. 

Name:	Untitled.jpg 
Views:	36 
Size:	39.0 KB 
ID:	159587

    This is how i'm trying to delete:

    Click image for larger version. 

Name:	Untitled1.jpg 
Views:	4 
Size:	70.7 KB 
ID:	159589

    In this case the Program Files folder but the same message i'm getting on the other folders.
      My ComputerSystem Spec

  2.    22 Oct 2017 #2

    You need to give yourself a full permission and take ownership of the folders.

    1. In Windows 10 type cmd.exe into Start Menu, right-click on Cmd.exe, and open it as an administrator.

    2. Type following commands:

    Code:
    Takeown  /f  D:\Windows /r  /D Y
    
    Takeown  /f   "D:\Program Files"  /r  /D Y
    
    Takeown  /f   "D:\Program Files(x86)"  /r  /D Y
    
    Attrib  -s  -r  -h  D:\ProgramData
    
    Takeown  /f   D:\ProgramData  /r  /D Y
    
    Icacls  D:\Windows  /grant  %Username%:F   /t   /c
    
    Icacls  "D:\Program Files"  /grant  %Username%:F   /t   /c
    
    Icacls  "D:\Program Files(x86)"   /grant  %Username%:F   /t   /c
    
    Icacls  D:\ProgramData  /grant  %Username%:F   /t   /c
    After executing the commands try deleting the folders.
      My ComputerSystem Spec

  3.    22 Oct 2017 #3

    Could you explain please what are the commands do and why did you make attrib only for programdata but not the other directories ? And if i have a directory or file that is not related to one of this directories what should i do ?
      My ComputerSystem Spec

  4.    22 Oct 2017 #4

    The Takeown command allows an administrator to recover access to a file that was denied by re-assigning file ownership.

    Below command gives your user account ownership of the Windows folder and files/subfolders of the Windows folder.

    Code:
    Takeown  /f  D:\Windows /r  /D Y
    The Attrib command displays or changes file/folder attributes.

    Below command clears hidden, read only and system attributes of the ProgramData folder this is done because Takeown command cannot take ownership of the hidden folder/file. The D:\ProgramData folder by default is hidden.

    Code:
    Attrib  -s  -r  -h  D:\ProgramData

    The icacls command is use for modifying or displaying files/folders NTFS permissions.

    Below command given your user account full permission to Windows folder and its files/subfolders.

    Code:
    Icacls  D:\Windows  /grant  %Username%:F   /t   /c
      My ComputerSystem Spec


  5. Posts : 246
    trying to install win10
       22 Oct 2017 #5

    You can delete them from booted winpe/winre.
      My ComputerSystem Spec

  6.    22 Oct 2017 #6

    Rather then trying to Delete Windows System files, why not save any personal files under D:\Users\[YourUserName] (ie) Documents, Pictures, Music, to a different drive, like your C:\ Windows 10 drive, and then Format the D:. drive. Once that is done, you can restore your personal files back to D: as a backup.
      My ComputerSystem Spec

  7.    23 Oct 2017 #7

    spunk said: View Post
    Rather then trying to Delete Windows System files, why not save any personal files under D:\Users\[YourUserName] (ie) Documents, Pictures, Music, to a different drive, like your C:\ Windows 10 drive, and then Format the D:. drive. Once that is done, you can restore your personal files back to D: as a backup.
    I have on D: too much data like movies programs and other stuff more then 300GB it will take me too much time to copy it and on C: it's the new windows installation C: is smaller hard disk. Deleting the old windows from D: in this case at least is the faster way.
      My ComputerSystem Spec


  8. Posts : 31,106
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)
       23 Oct 2017 #8

    The simplest and safest way to "Take Ownership" of a folder or file is to use the context menu option provided in this TF tutorial. Then right click the folder or file in question, and click Take Ownership. You then own it, and can move/copy/delete/modify anything you wish. Just be cautious, it does exactly what it says. Use wisely.

    Add Take Ownership to Context Menu in Windows 10 User Accounts Tutorials

    TC
      My ComputersSystem Spec


 

Related Threads
Hi, I was wondering how important the two mentioned folders are when installing a software. I know most programs suggest being installed to one of them, but it is really necessary? What happens if I choose another folder? I use the game client...
Hi all, to start I am not particularly adept with computers so please bare with me. I am using an HP laptop running windows 10 home edition. Today from nowhere i suddenly started having this issue, When I try to rename a folder it tells...
My Win10 Home is regularly updated by MS. After a recent update I find I am no longer able to update or completely remove applications. An example: Firstly, I am logged in as an administrator. I recently ran a program that informed me that an...
Hi, I ran a program that created some files and folders in C:\Program Files\Utilities\NewApp. I can see the files and folders using NewApp's browser, but I could NOT see them in Explorer. I now realize that I can only see NewApp's created...
:mad: :banghead::mad: :banghead::mad: :banghead::mad: Using Windows 10: I just looked into my C:\Windows.old directory and both Program Files and Program Files (x86) have disappeared !!! WHY ??? WHO WOULD DO THIS ??? This is criminal !!! ...
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 22:40.
Find Us