Windows if命令出现奇怪的错误
我刚刚完成了一个批处理文件。当我运行它时,我面临一个奇怪的错误!以下是初学者的第一个代码:Windows if命令出现奇怪的错误,windows,batch-file,sed,cmd,Windows,Batch File,Sed,Cmd,我刚刚完成了一个批处理文件。当我运行它时,我面临一个奇怪的错误!以下是初学者的第一个代码: findstr "ro.product.model=" build.prop >tmp.txt cscript "sed.vbs" "tmp.txt" "ro.product.model=" "" set /p device=>tmp.txt del "tmp.txt" cd C:\Kitchen\WORKING_FOLDER\system echo Is you
findstr "ro.product.model=" build.prop >tmp.txt
cscript "sed.vbs" "tmp.txt" "ro.product.model=" ""
set /p device=>tmp.txt
del "tmp.txt"
cd C:\Kitchen\WORKING_FOLDER\system
echo Is your device a MediaTek (MTK) device?
set /p remt= y or n?
if %remt%==y goto mk
if %remt%==n goto no
:no
if %device% == GT-I9001 (
set bootimg=/dev/block/mmcblk0p8
goto bdrom
)
这只是其中之一,大约有67个。当我执行并选择n以前进时,程序退出并出错:
( was unexpected at this time
我试着移除支架等,但没有任何效果!即使命令的语法也是正确的,我也不明白我在哪里出错。您的˙%device%˙结果是一个空字符串,因此if==GT-I9001中出现了错误语法。设置设备时重定向错误。您应该从文件中获取stdin,例如set/p device=如何更正它@我是新来的对不起你能详细解释一下吗me@YaMan当前位置他已经做到了。再次阅读他的评论。