The curious case of the missing exclamation mark in CMD files

前端 未结 3 1426
北荒
北荒 2021-01-06 08:02

I have whittled down a more complex CMD script to the essentials. It reads an input file line by line, unquotes it (if quoted) and writes it out to another CMD file.

3条回答
  •  夕颜
    夕颜 (楼主)
    2021-01-06 08:33

    Like this :

    @echo off
    
    (for /f "delims=" %%a in ('type bang1.txt') do echo  echo P1:[%%~a])>bang2.cmd
    

提交回复
热议问题