Windows 2000/XP delete stubborn files solution

  

There are generally several cases of such problems:

One: located on the NTFS file system, and used ACL (Access Control List) , no access to the file you want to delete;

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

3: The file system is corrupted and the file you want to delete cannot be accessed;

Four: The path to the file is too long to be accessed;

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 use the following methods: log in with an administrator account, right-click on the inaccessible file, select Properties, select the "Security" tab, select the "Advanced" button, and then select "Owner" & rdquo; Tab, change the owner to & rdquo; select the administrator account in the box, reverse the color, and then click the "application" button to make the owner your own. Finally click the OK button twice to close the properties dialog. Open the Properties dialog again and you can see that the “Add” button under the “Security” tab has been programmed. Click this button and type in the “Select User and Group” dialog box. Access the account name of this file (note the format: computer name\\account name).

Click the OK button to return to the previous dialog box, then select the Full Control checkbox in the “Account Name Permissions"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

A 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 log out the pre-read function;

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

e) use third-party tools that can browse local files, such as FlashFXP, CuteFTP, etc., 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.

Exclusion method: 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\\

As you can see, you can save a lot of length after using the 8.3 format. 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 a delete command, Windows will check if 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.

We have 3 ways to delete such files:

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

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

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

b) Using command line tools A special parameter is resolved:

RD\\\\.\\:\\\\

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

Follow the delete command \\\\ The .\\ parameter prevents Windows from checking the legitimacy of file names, so files containing Windows reserved words or illegal names can be deleted.

c) For files, if wildcards are available, they can also be resolved with wildcards:

DEL DEL PR?.*

DEL LPT?.*

Copyright © Windows knowledge All Rights Reserved