3

I process photos into individual folders, each folder includes subfolders. I want to search and delete all *.jpg files in all the highest level folders.

How could I tell Windows to find and delete all *.jpg in the highest level folder only, but leave all the subfolders untouched?

Oliver Salzburg
  • 89,072
  • 65
  • 269
  • 311
Scott D
  • 33

2 Answers2

1

The following in a command line should work:

cd C:\path\to\the\folder
del *.jpg

It should not recurse into subdirectories, based on the documentation. I've not personally tested though, so you might want to run a small test first to be sure. (Always double check when you're not 100% sure and performing a delete of any sort!)

If you do want it to recurse into subdirectories, then use the /S switch:

cd C:\path\to\the\folder
del /S *.jpg 
Darth Android
  • 38,658
0

Try this...

Search Parameters: type:jpg -folderpath:TopLevelFolderName\*\

DxTx
  • 1,276