Originally posted by HAT at 2008-8-6 20:06:
把你的完整代码贴出来看看
@echo off
title set station ID for mPCIe
mode con cols=100 lines=20
setlocal enabledelayedexpansion
set /p IP=please input the IP number:
set /p ID=please input the ID number:
cd\
d:
for /r d:\zt4_rev\T1 %%a in (*.cfg) do (
set temp=%%a
set mo=!temp:~16,14!
set phase=!temp:~13,2!
set dirc=!temp:~0,31!
cd !dirc!
del sfis.cfg
echo >>sfis.cfg
echo MP_PN=!mo!>>sfis.cfg
echo RMA_PN=NA>>sfis.cfg
echo SN_LENGTH=13>>sfis.cfg
echo.>>sfis.cfg
echo >>sfis.cfg
echo Enable=1>>sfis.cfg
echo SFIS_TIMEOUT = 25000>>sfis.cfg
echo SFIS_IP=10.5.5.!IP!>>sfis.cfg
echo SFIS_Port=5010>>sfis.cfg
echo FixtureID=!phase!_!ID!>>sfis.cfg
echo LINE=ZT4>>sfis.cfg
echo.>>sfis.cfg
echo >>sfis.cfg
echo ChipId=none>>sfis.cfg
echo FA_Debug=disable>>sfis.cfg
echo SfCheckAutoFocus=disable>>sfis.cfg
echo.>>sfis.cfg
echo >>sfis.cfg
echo R=255>>sfis.cfg
echo G=0>>sfis.cfg
echo B=0>>sfis.cfg
echo Message="ERROR!">>sfis.cfg
echo.>>sfis.cfg
echo >>sfis.cfg
echo Enable=0>>sfis.cfg
echo ApplicationPath=fciv.exe>>sfis.cfg
echo CheckSumPath=imagefile_12MB.cks>>sfis.cfg
echo ConfigPath=param.ini>>sfis.cfg
echo BlockName=Options>>sfis.cfg
echo ItemName=UpLoadImagePath>>sfis.cfg
)
只有第一个目录得到想要的结果,其他的都如下:
MP_PN=1602-276201-02
RMA_PN=NA
SN_LENGTH=13
.
Enable=
SFIS_TIMEOUT = 25000
SFIS_IP=10.5.5.80
SFIS_Port=5010
FixtureID=T1_27
LINE=ZT4
.
ChipId=none
FA_Debug=disable
SfCheckAutoFocus=disable
.
R=255
Message="ERROR"
.
Enable=
ApplicationPath=fciv.exe
CheckSumPath=imagefile_12MB.cks
ConfigPath=param.ini
BlockName=Options
ItemName=UpLoadImagePath