Tagrecursive

Recursively Delete Selected Files or Folders In Windows

R

I was looking around for a way to recursively delete files and folders of a specific name in Windows. For example, imagine having “/folderA/folderB/file1.doc” and “/folderA/folderC/file1.doc”, and I wanted to remove all instances of file1.doc. Now imagine this file1.doc being presented in hundreds of folders. Deleting each file manually would drive anyone crazy. I know...

Recursively Delete Files and Retain Folders in Windows

R

I was trying to delete all files in the current directory and all subdirectories, while keeping the directory structure intact. I found that I could use the following DOS command to recursively delete files, and NOT touch the directories: ending in .doc del /s *.doc Do note though, that ALL files with the extension doc will be deleted. You can change .doc to something else, .mp3 .pdf .wav .am .rm...

About Author

I've over 17 years of entrepreneurship experience, having built a tech company to be the top in the country, which was subsequently acquired for an 8-figure sum. As CEO, I led the company through robust growth to 150 employees across 4 countries. After the acquisition, I embraced minimalism, sold off my personal possessions, and started living around the world.

Read more about my story here.