What happens when I delete a file or folder?

Source: Internet
Author: User
Tags inheritance parent directory safe mode valid file permissions

In the daily use of the system, we often encounter the situation that the file is not deleted, the "delete file or folder Error" or "folder access Denied" and so on, and so on, will be encountered in the XP/WIN7/WIN8 system. Cannot be solved with the usual method, the following small series will try a variety of unconventional methods to completely remove these stubborn files or folders.

  One, the general solution:

1. Note or restart the computer, and then try to delete it.

2. Go to "Safe Mode delete".

3. Use the Del,deltree and RD commands on the Pure DOS command line to remove them.

4. If there are more subdirectories or files in the folder that cannot be deleted, delete the subdirectories and files in the folder before deleting the folders.

5. End the Explorer.exe process in Task Manager, and then delete the file from the Command Prompt window.

6. If you have several software to install acdsee,flashfxp,nero,total, you can try to delete the folder in these software.

  Second, Advanced Solutions:

The more general way to do this is to change file permissions, right-click File-Properties--security--edit. Modify file permissions, if prompted to modify the permissions, first modify the file owner, right-click File-Security-advanced-owner ... However, when there is more than one such file, this operation is not real. So a brief introduction to two tools:takeown and cacls

  Takeown allows the administrator to regain access to the file that was previously denied access in a way that assigns file ownership .

  Software Name: System file Permission picker (TAKEOWNERSHIPEX) v1.1.0 Green Edition

Parameters:

/S system Specifies the remote system to connect to.

/u [domain]user Specifies the user context, the command executes in this context.

/p [Password] specifies the password for the given user context. If omitted, prompt for input.

/f filename Specifies the file name or directory name pattern. You can specify a pattern with the wildcard character "*". The share name file name is allowed.

/A assigns ownership to the Administrators group, not the current user.

/R recursion: Indicates that the tool is running on a file in the specified directory and sub-directory.

/d Prompt The default answer is used when the current user does not have the "List Folders" permission in a directory. This happens when a recursive (/R) operation is performed in a subdirectory. Take ownership with a valid value of "Y" or skip with "N".

Here are a few common examples

takeown/f lostfile:: Lostfile ownership to the current user

takeown/f directory/r/A:: Recursive way to file all permissions in directory directory to the Administrators group

TAKEOWN/F *:: Ownership of all files in the current directory to the current user

takeown/f%windir%*.txt

  cacls the access control list used to display or modify files.

  software name: cacls.exe Download

Parameters:

CACLS filename [/T] [/M] [l] [/S[:SDDL]] [/E] [/C] [/g user:perm]

[/R user [...]] [/P User:perm [...]] [/d User [...]]

FileName Displays the ACL.

/T Changes the ACL of the specified file in the current directory and all its subdirectories.

/L handle symbolic link itself against target

/M Changes the ACL of the volume mounted to the directory

/S The SDDL string that displays the DACL.

/S:SDDL replaces the ACL with the ACL specified in the SDDL string. (/E,/g,/r,/p or/d are not valid).

/e Edit the ACL without replacing it.

/C Continue when an Access denied error occurs.

/g User:perm gives the specified user access rights.

Perm can be: R read

W Write

C Change (write)

F Full Control

/r user revokes the access rights of the specified user (only valid when used with/E).

/P User:perm replaces the access rights for the specified user.

Perm can be: N None

R Read

W Write

C Change (write)

F Full Control

/d user denies access to the specified user.

You can use wildcard characters to specify multiple files in a command.

You can also specify multiple users in the command.

Abbreviation:

CI-Container inheritance. The ACE is inherited by the directory.

OI-Object inheritance. Aces are inherited by files.

IO-Inherit only. The ACE does not apply to the current file/directory.

ID-Inherited. Aces inherit from the ACL of the parent directory.

  For example:

  cacls filename/e/P administrators:f change Administrators access to filename to Full Control

  cacls */e/c/P administrators:f change Administrators to Full Control for all file access

  With these two commands, you can take ownership of the file in bulk and then delete the file normally.

Note : More wonderful tutorials Please pay attention to the triple computer tutorial section, triple Computer office group: 189034526 Welcome to join

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.