The system can not delete the file solution

  

Some files are no longer useful, we do not want him to take up the hard disk resources, but want to delete and delete, what should we do this time? Please see the following article about the solution to the failure to delete files in Windows 2000/XP.

There are several situations in which such problems occur:

One: Located on the NTFS file system, and using ACL (Access Control List), there is no permission to access the file you want to delete. ;

Two: The file is being used by another program user;

Three: The file system is corrupted and the file you want to delete cannot be accessed.

Four: The path of the file is too Long results in inaccessibility;

Five: The file name uses illegal characters or Windows reserved keywords.

The corresponding solution for each case is as follows:

Case 1. You can use the administrator account to obtain access rights by resetting the ACL method

For this case You can do this by logging in with an administrator account, right-clicking on an unreachable file, selecting Properties, selecting the "Security" tab, selecting the "Advanced" button, and then selecting the "Owners" tab. The owner changes to " BOX selects the administrator account, reverses the color, and then clicks the "Apply" button to make the owner your own. Finally click the OK button twice to close the properties dialog. Open the properties dialog again, you can see that the "Add" button under the "Security" tab has been programmed to select the optional state, click this button, enter the account name you want to access this file in the "Select User and Group" dialog box. (Note the format: computer name\\account name).

Click the OK button to return to the previous dialog box, then select the Full Control check box in the "Permissions for Account Name" box and click OK to regain access. Similarly, you can use the cacls command to assign permissions in command line mode.

Case 2, find the program that uses the deleted file and close

The common fault occurs when deleting an AVI file. Because Windows has a read-ahead mechanism, read-ahead makes the file in use and cannot be deleted. There are many solutions:

a) Close all resource managers, use the command del or rd to delete files or directories (recommended);

b) Delete the following key in the registry: < Br>

HKEY_LOCAL_MACHINE\\SOFTWARE\\Classes\\CLSID\\

{87D62D94-71B3-4b9a-9489-5FE6850DC73E}\\InProcServer32. It is recommended to export the backup registration key value so that it can be restored later if needed.

c) Enter the DOS command window and run: REGSVR32 /U SHMEDIA.DLL to cancel the pre-read function;

d) "Windows traditional style folder" view mode (folder option - select below task)

e) Use a third-party tool that can browse local files, such as FlashFXP, CuteFTP, etc., to delete.

Case 3, Check the file system, troubleshoot

When you see the following tips, you need to pay attention to your file system:

:\\ is not accessible

The file or directory is corrupt and non-readable.The file or directory iscorrupt and non-readable. The file or directory \\ is corrupt andunreadable.

Please Run the Chkdsk utility.

Remedy: Check your drive with the chkdsk command. Repair damaged file system. There are many causes, such as bad sectors of the hard disk, hardware device errors or software bugs that may cause this problem.

Case 4, the path is too long, more than 255 bytes that most Windows can accept (NTFS file system does not have this problem)

Use 8.3 format to reduce the length or change the part of the path Directory name to reduce the length of the path. For example, you can temporarily change the name of some directories in the path, or use the 8.3 format in command line mode. For example: Suppose the file you want to delete is located in the following path:

C:\\Documentations\\HOWTO\\2003\\May\\WindowsDocumentations\\ForWebsites_Forum\\

Tips\\Smallfrogs\\Smallfrogs_Test_Project\\YuanChuan_Articls\\20030530\\TheTroubleShootingAboutCannotDeleteFilesInWindows \\

The above directory is enough to express meaning, but the path length is still not enough 255 bytes.

Then you can type:

cd C:\\Docume~1\\howto\\2003\\may\\window~1\\forweb~1\\tips\\smallf~1\\yuanch~1\\20030530\\ Thetro~1\\

It can be seen that using the 8.3 format can save a lot of length. Because entering this directory with long paths is not a problem. Once you have entered this type of directory, you can use the del name to delete the files you want to delete.

Case 5, because Windows believes that this naming is illegal or that the naming is related to hardware devices. Common reserved words are LPT1, CON, and so on.

For files with reserved words, when we issue the delete command, Windows will check whether the deleted file has a valid path. If your file name contains illegal characters or reserved words that Windows considers, then The deletion will fail.

There are 3 ways to delete such files:

a) Using Linux or other non-Windows operating systems, Linux/Unix as an example: you can use the rm command to delete:

rm -d //driveletter /path using forward slashes /filename

rm -r " //C /Program Files /BadFolder "

b) using the command line tool A special parameter is solved:

RD\\.\\:\\

DEL\\.\\driveletter:\\path\\filename

Follow the delete command followed by the \\.\\ parameter You can avoid Windows checking the legality of file names, so you can delete files that contain Windows reserved words or illegal names.

c) For files, if you can use wildcards, you can also solve using wildcards:?.

DEL DEL PR *

DEL LPT *?.

Copyright © Windows knowledge All Rights Reserved