Windows – How to empty a folder in a command prompt? (Windows7)

windows 7

Need to empty a folder in Windows 7 from the command prompt or batch file. This means deleting all the files and all sub folders and leaving the empty folder.
del /s /q leaves empty subfolders so this solution doesn't work for me. I don't want to delete and recreate the folder either.

Best Answer

You can use the sdelete (Secure delete) command to clean a folder.

sdelete -s *

from with in said folder to clear all of the contents.