1.    4 Weeks Ago #1
    Join Date : Sep 2015
    Posts : 33
    windows 8

    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.    4 Weeks Ago #2
    Join Date : Oct 2017
    Posts : 460
    Windows 10 Pro 64-bit

    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.    4 Weeks Ago #3
    Join Date : Sep 2015
    Posts : 33
    windows 8
    Thread Starter

    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.    4 Weeks Ago #4
    Join Date : Oct 2017
    Posts : 460
    Windows 10 Pro 64-bit

    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.    4 Weeks Ago #5
    Join Date : Jun 2015
    Posts : 217
    trying to install win10

    You can delete them from booted winpe/winre.
      My ComputerSystem Spec
  6.    4 Weeks Ago #6
    Join Date : Jun 2016
    Los Angeles
    Posts : 1,041
    Windows 10 Pro

    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.    4 Weeks Ago #7
    Join Date : Sep 2015
    Posts : 33
    windows 8
    Thread Starter

    Quote Originally Posted by spunk 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.    4 Weeks Ago #8
    Join Date : Oct 2014
    Arnold, MD
    Posts : 28,985
    Triple boot - Win 10 Pro, Win 10 Pro Insider (2) - (and a sprinkling of VMs)

    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

 


Similar Threads
Thread Forum
Solved Are the Program Files and Program Files (x86) folders important?
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...
General Support
Why can't I rename or delete files and folders? Windows 10 home
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...
General Support
Solved Unable to delete Program Files (X86) folder and files
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...
General Support
Can't see all files/folders in Program Files
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...
General Support
WHO DELETED MY C:\Windows.old\Program Files & (x86) FOLDERS ????
: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 !!! ...
Installation and Upgrade
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 07:14.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums