Batch : read lines from a file having spaces in its path

后端 未结 3 653
逝去的感伤
逝去的感伤 2021-01-12 11:15

To read lines from a file, in a batch file, you do :

for /f %%a in (myfile.txt) do (
    :: do stuff...
)

Now suppose you file is in

3条回答
  •  伪装坚强ぢ
    2021-01-12 11:52

    Found it.

    for /f %%a in ('type "C:\Program Files\myfolder\myfile.txt"') do (
        echo Deleting: %%a
    )
    

    Don't even ask me why that works.

提交回复
热议问题