我正在编写批处理文件。这是一个示例:
if exist rootsys.txt del rootsys.txt
if %lang%==1 (
if %bit%==32 echo C:\Program Files\path\to\the dir>rootsys.txt
if %bit%==64 echo C:\Program Files(x86)\path\to\the dir>rootsys.txt
goto :waset
)
这种情况持续了六次(if %lang%==2
等等...... if %lang%==6
。)
所以,它做了什么,用户放入了什么,比如'6',所以它会为第六个做点什么。
但是,每当我尝试这个时,它最终会以\the was unexpected at this time
结束。
所以,我尝试使用@echo on
进行调试。似乎它在if exist rootsys.txt del rootsys.txt
给了我错误。怎么会发生这种情况?!
我110%确定我没有提到the
(实际上我将其用作示例,它有另一个名称)我的批处理文件中没有其他地方。谁能帮我?我真的被困在这里了。
答案 0 :(得分:2)
将C:\Program Files\path\to\the dir
字符串与"