The solution when deleting a folder prompts that the directory is not empty: first open the command prompt; then execute the [Start drive letter:\folder name\] command to delete it. We can also restart the computer and enter the system safe mode to delete it.
Solution:
1. Special folders cannot be deleted
The so-called special folders refer to Folders created by special methods. Of course, you want to use ordinary methods to delete such folders, that's not possible. This type of folder appears as:
①Creation method
Command format: MD Drive letter:\folder name..\
Example: MD C:\MyFile. .\
In this way, we created a special folder in the root directory of drive C. The name of the folder is MyFile. Please note that there is a . (a dot) after the folder name
Once the folder is created, it cannot be opened or deleted using ordinary methods.
②Open method
Command format: Start drive letter:\folder name..\
Example: Start C:\MyFile..\
③Delete method
Command format: RD drive letter:\folder name..\
Example: RD C:\MyFile..\
If you cannot delete A folder with a dot after its name indicates that it is a special folder. If you want to delete it, please use the above method.
2. Ordinary folders cannot be deleted
If it is just an ordinary folder, please refer to the method below:
①General solution
A: Log out or restart your computer and try deleting it again.
B: Enter "Safe Mode Delete".
CC: Use DEL, DELTREE and RD commands to delete it under pure DOS command line.
D: If there are too many subdirectories or files in the folder that cannot be deleted, you can delete the subdirectories and files in the folder first, and then delete the folder.
E: End the Explorer.exe process in the task manager, and then delete the file in the command prompt window.
F: If you have installed ACDSee, FlashFXP, Nero and other software, you can try to delete folders in these software.
②Advanced solution
A: Disk error
Run a disk scan and scan the partition where the file is located. Before scanning, make sure you have selected repair files and bad sectors, comprehensive Scan all options and delete files after scanning.
B: Pre-reading mechanism
Some media cannot be deleted when their playback is interrupted or they are being previewed. In the "Run" box, enter: REGSVR32 /U SHMEDIA.DLL to cancel the pre-reading function. Or delete the following key value in the registry: [HKEY_LOCAL_MACHINE\SOFTWARE\Classes\CLSID\{87D62D94-71B3-4b9a-9489-5FE6850DC73E}\InProcServer32].
C: Firewall
Since the anti-virus software will occupy the file being checked when checking for viruses, it will prompt that the file is in use when deleting it. In this case, you can try to temporarily turn off its real-time Monitoring program may be able to solve it.
D: OFFice, WPS series software
Illegal closing of OFFice will also cause the file to be unable to be deleted or renamed. Rerun the program, then close it gracefully before deleting the files.
E: With the help of WinRAR
right-click the folder to be deleted and select "Add to compressed file". In the pop-up dialog box, select "Delete source files after compression." Just write a compressed package name and click OK.
F: File shredding method
Use a file shredder, such as File Pulverizer, to completely delete some stubborn files.
The above is the detailed content of What should I do if the folder prompts that the directory is not empty when deleting a folder?. For more information, please follow other related articles on the PHP Chinese website!