Search code examples
cmddirectoryrmdir

How to delete all files and sub-directorys from a dir without delete the dir in Windows CMD?


Hi I'm looking for a command similar to this command in Linux:

rm -fRv debug/*

This command delete all files and directories that is inside debug but without delete the debug directory.

How can I do this in Windows with CMD ?

bye


Solution

  • for /d %x in (debug\*) do @rd /s /q "%x"
    del /s /f /q debug\*