how to delete a folder and subfolders in command prompt code example
Example 1: delete folder and its subfolders in python
import shutil
shutil.rmtree('/path/to/your/dir/')
Example 2: remove folder with content cmd
rmdir folder/path /S /Q
Example 3: create batch file to delete folders and subfolders
Echo batch file to delete folder
@RD /S /Q "D:\testfolder"
Example 4: how to delete dir in windows cmd
to remove an unempty file from cmd directory
$ rmdir /S nonemptyfile