What if the computer can't erase the file?

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

first, the general solution:

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

2. Go to "Safe Mode delete".

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

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

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

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

Second, Advanced Solutions:

A more general approach to this problem is to change the file permissions, and the right key file--the attribute--security--edits. Modify file permissions, if prompted not to modify permissions, first modify the file owner, right key file-security-advanced-owner ... However, when there are more than one such file, this operation is not true. So a brief introduction to the two tools: Takeown and cacls

TAKEOWN allows administrators to regain access to files that were previously denied access by reassigning file ownership.

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

Parameters:

/S system Specifies the remote system to which you want to connect.

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

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

/f filename Specifies the filename or directory name pattern. You can use the wildcard character "*" to specify a pattern. Allow share name file name.

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

/R recursion: Instructs the tool to run on a file in the specified directory and subdirectory.

/d Prompt The default answer is used when the current user does not have the "List Folders" permission in a directory. This occurs when a recursive (/R) operation is performed in a subdirectory. Use valid value "Y" to get ownership 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 all permissions in directory directory to the Administrators group

TAKEOWN/F *:: All files under the current directory ownership to the current user

takeown/f%windir%*.txt

cacls is used to display or modify the access control list for a file.

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 ACLs.

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

/L handle symbolic link itself against target

/M Changes the ACLs of the volumes mounted to the directory

/S Displays the SDDL string for the DACL.

/S:SDDL replaces ACLs with the ACLs specified in the SDDL string. (/e,/g,/R,/p, or/d is not valid).

/e Edit ACLs without replacing them.

/C Continue when a denial of access 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 access rights for the specified user (only when used with/e).

/P User:perm replaces the access rights of 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-only inherited. ACE does not apply to current file/directory.

ID-Inherited. The ACE inherits from the ACL of the parent directory.

For example:

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

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

These two commands allow you to bulk get the ownership of a file 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 you 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.