Package for a list of folders that do not contain a specific file

Is there a way to save in a text file all folders (full path) that do not contain a file named "test", for example.

+4
source share
1 answer

This should work

@echo off for /d /r %%f in (*) do ( if not exist %%f\test.txt ( echo %%f >>C:\folders.txt ) ) 

This will lead to the output of all folders that do not contain the test.txt file to the C:\folders.txt , just tweak / adjust your needs.

+6
source

All Articles