Delete stubborn files, Windows + cmd

Source: Internet
Author: User

It seems that I have already written about how to delete the Adobe CMP folder, but I seem to have forgotten it, but it doesn't matter ....

Experiment results:

File owner-plays a key role in determining whether a file can be deleted.

If I am not the owner, I obviously cannot obtain higher permissions.

But ....

Changing the folder owner cannot affect the files in the folder-this is how Windows works. In this case, unless you modify so many files one by one

To delete commands in batches.

At first I thought of attrib, but the result is: the file is a + R.

Because I do not have sufficient permissions, there is no way for these two attributes.

Then find the cacls: display or modify the access control table (ACL) of the file)

View the description and find that the/g option can grant the specified user access permission.

For example, you can add the "full control" permission for a file to the Administrator: cacls file/g administrator: F
The permission can be granted to a folder and all its files as follows: cacls DIR/g administrator: F/T

Finally, delete the folder:
Rmdir/S/Q cmap

Done!

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.