How do you suppress environment variable expansion within DOS and Windows CMD?

后端 未结 2 776
借酒劲吻你
借酒劲吻你 2020-12-11 04:07

This is a simplified example with modified variable names of what I want to do. Also for simplicity sake, I am showing the command line version rather than the bat file ver

2条回答
  •  情深已故
    2020-12-11 04:37

    Within a batch file, use two %%s, e.g.:

    set foo=1
    echo %%foo%%
    

    ...echoes "%foo%", not "1". I'm not aware of a way to disable it in immediate mode (e.g., not in a batch file).

提交回复
热议问题