Windows cmd in the current directory, how to maintain all directory structures and delete all files.

From the Windows command prompt (CMD), you can use the following command to delete all files in the current directory and its subdirectories:

del /s /q *

This command will delete all files in the current directory and its subdirectories without prompting for confirmation. Note that this command will delete all files in the directory, including read-only and system files.

If you only want to delete files in the current directory, but not in subdirectories, you can use the following command:

del /q *

This command will delete all files in the current directory without prompting to confirm deletion.

Before executing these commands, you need to open a command prompt window and use cdthe command to change the current directory to the directory where you want to delete the file.

If you only want to delete the files in the current directory and its subdirectories, without deleting the directory itself, you can use the following command:

del /s /q /f /a:-d *

This command will delete all files in the current directory and its subdirectories, but not the directory itself. Among them, /fthe parameter specifies to forcibly delete read-only files and system files, and /a:-dthe parameter specifies to delete only files without deleting directories.

If you only want to delete files in the current directory, but not in subdirectories, you can use the following command:

del /q /f /a:-d *

This command will delete all files in the current directory, but not the directory itself.

Before executing these commands, make sure you have backed up your important files and data, and you have confirmed which files you want to delete.
Finally, deleting files is a dangerous operation, please make sure you have backed up important files and data before executing these commands, and you have confirmed the files you want to delete.

Guess you like

Origin blog.csdn.net/qq_22815083/article/details/130194538