Secrets of Windows Vista #11: delete undeletable things

Source: Internet
Author: User
Address: http://blogs.msdn.com/tims/archive/2006/11/10/windows-vista-secret-11-deleting-the-undeletable.aspx
By Tim Sneath
Translation: Tony Qu (from the BluePrint Translation Team)

Most of us are switching from early Windows XP or Windows Vista to final RTM. I think this tip is suitable for us. You know that Windows Vista has many different ways to upgrade your computer, from directly replacing the installation (insert CD, run the installation, and select the upgrade) to Windows Easy Transfer (allows you to copy settings, programs, and data from an old installation to a new system environment ). However, I am a purification commentator who does not want to have any fragments and insists on installing the system to a pure partition without any stains.

During installation, even the administrator can find folders that cannot be accessed, because the account ACL settings are completed by the SID originally applied to the old partition. For example, on my home machine, I changed the C: And D: Drive lines and installed Windows Vista RTM to a new drive letter. When I test and confirm that everything works well, I want to delete some old redundant directories (such as the old program files directory ). If the administrator cannot access these files, how can you obtain the permissions?

The secret is hidden in two command line tools, one of which is relatively old and the other is completely revised for this version. They are takeown (you can get a file or directory ownership) and icacls (you can set a new ACL for a directory ). I created a batch processing program named itsmine. cmd on my system, as shown below:

Takeown/f % 1/r/d y
Icacls % 1/grant administrators: F/t

In an upgraded (elevated) command prompt, you can run a command, such as itsmine d: \ hard_to_delete, which resets the ACL with the permission and the hard_to_delete directory, for example, rd/s d: \ hard_to_delete should be run.

Last week, these two lines of commands have reduced my pain because I am getting familiar with them and re-installed Windows Vista RTM on each calculator: I hope they will also work for you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.