gpt4 book ai didi

windows - 批处理以列出不包含特定文件的文件夹

转载 作者:可可西里 更新时间:2023-11-01 13:58:13 26 4
gpt4 key购买 nike

有没有办法将所有不包含名为“test”的文件的文件夹(完整路径)保存在文本文件中。

最佳答案

这应该可行

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

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

关于windows - 批处理以列出不包含特定文件的文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11688019/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com