This batch file deletes all files and folders from a specified directory. It first echoes a message stating it will delete all files from the given path, and uses the DEL command to delete all files in that directory with the force and quiet switches. It then echoes a message saying it will delete all subfolders, and uses a FOR loop with the RD command to recursively and quietly delete all subfolders within the given directory path. It finishes with an exit message.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
69 views1 page
Delete Folders in Batch
This batch file deletes all files and folders from a specified directory. It first echoes a message stating it will delete all files from the given path, and uses the DEL command to delete all files in that directory with the force and quiet switches. It then echoes a message saying it will delete all subfolders, and uses a FOR loop with the RD command to recursively and quietly delete all subfolders within the given directory path. It finishes with an exit message.