Aug 17, 2021

[Windows] how to delete specified files including those in all sub-folders at once

 In Command Prompt window,

          del   /s   *.txt 

It will delete all files with extension "txt", all files including those in all sub-folders.


You can add "/f", "/q" like   del  /s /f /q  *.txt

/f : force to delete read-only files

/q: it won't ask you to confirm deletion



If you want to delete all files and sub-folders at once,

        rmdir  /s  aaa

where aaa is the name of folder you want to delete.


No comments:

Post a Comment