How can I test if a list of files exist?

后端 未结 6 1890
粉色の甜心
粉色の甜心 2021-02-15 18:38

I have a file that lists filenames, each on it\'s own line, and I want to test if each exists in a particular directory. For example, some sample lines of the file might be

6条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-15 19:14

    for /f %i in (files.txt) do @if exist "%i" (@echo Present: %i) else (@echo Missing: %i)
    

提交回复
热议问题