【发布时间】:2010-01-01 17:00:26
【问题描述】:
我正在编写一个批处理文件。这是一个示例:
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(实际上我将其用作示例,它有另一个名称)。谁能帮我?我真的被困在这里了。
【问题讨论】:
标签: windows time batch-file cmd