Batch - Echo or Variable Not Working

后端 未结 2 627
醉梦人生
醉梦人生 2021-01-30 19:36

I have this little batch script:

SET @var = \"GREG\"
ECHO %@var%
PAUSE

When I run it, it prints:

H:\\Dynamics>SET @var = \"G         


        
2条回答
  •  没有蜡笔的小新
    2021-01-30 20:15

    Try the following (note that there should not be a space between the VAR, =, and GREG).

    SET VAR=GREG
    ECHO %VAR%
    PAUSE
    

提交回复
热议问题