使用 Windows cmd.exe
dir /b /od > list.txt
创建一个最后一行是list.txt的文件。如何避免字符串 list.txt 出现在文件 list.txt 中?
最佳答案
dir /b /od |findstr /v /b /e "list.txt" >list.txt
可能有更好的方法,但这很简单。
关于batch-file - Windows 批处理——保存文件名列表,不包括列表文件本身,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52191019/