delet folder and subfolders cmd code example
Example 1: delete all files in a directory cmd
del /S C:\Path\to\directory\*
Example 2: create batch file to delete folders and subfolders
Echo batch file to delete folder
@RD /S /Q "D:\testfolder"
del /S C:\Path\to\directory\*
Echo batch file to delete folder
@RD /S /Q "D:\testfolder"