我用了下列的脚本实现不了。麻烦大伙看看,我想实现机名等于computer01的话就跳转到01执行脚本后退出,否则按默认执行脚本后退出。
set computername>temp.txt
set file=temp.txt
set /p str=<%file%
if %str:~13%=="computer01" then goto 01
echo false >1.txt
exit
:01
echo true >1.txt
exit
[ Last edited by stjie on 2007-11-14 at 02:30 PM ]作者: lxmxn 时间: 2007-11-13 19:25
Quote:
if /i "%str:~13%"=="computer01" then goto 01
作者: stjie 时间: 2007-11-14 13:49
Quote:
Originally posted by lxmxn at 2007-11-13 19:25:
以下代码还是实现不了:
set computername>temp.txt
set file=temp.txt
set /p str=<%file%
if /i "%str:~13%"=="computer01" then goto 01