批量列出不包含特定文件的文件夹

Roc*_*shy 4 windows batch-file

有没有办法在文本文件中保存所有不包含名为"test"的文件的文件夹(完整路径),例如.

Bal*_*i C 6

这应该工作

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

这会将所有不包含该文件test.txt的文件夹输出到文件中C:\folders.txt,只需根据您的需要进行调整/调整.