635000
新手上路
积分 14
发帖 5
注册 2006-7-19
状态 离线
|
『楼 主』:
XP_SP2能用WIN98下DOS 不能使用
::XP_SP2能写内容到文件而WIN98下DOS 不能使用echo.82#>%MachineFileName%
::XP_SP2的"for"有参数可选, 而WIN98下DOS 不能选
::求高手能否修改为WIN98下DOS能用
echo off
set path=C:\BAT\
set 日期_1=060805
set MachineFileName=C:\BAT\machine_no.txt
if not exist %MachineFileName% echo.82#>%MachineFileName%
for /f %%b in (%MachineFileName%) do set machine_no=%%b
set machine_no#=0
for %%c in (01#,02#,03#,04#,05#,06#,07#,08#,09#,10#,11#,12#,13#,14#,15#,16#,17#,18#,19#,20#,21#,22#,23#,24#,25#,26#,27#,28#,29#,30#,31#,32#,33#,34#,35#,36#,37#,38#,39#,40#,41#,42#,43#,44#,45#,46#,47#,48#,49#,50#,51#,52#,53#,54#,55#,56#,57#,58#,59#,60#,61#,62#,63#,64#,65#,66#,67#,68#,69#,70#,71#,72#,73#,74#,75#,76#,77#,78#,79#,80#,81#) do if %machine_no%==%%c set machine_no#=1
if %machine_no#%==1 goto skip_1
if %machine_no#%==0 goto skip1
:fanhui
for /f %%b in (%MachineFileName%) do set machine_no=%%b
set machine_no#=0
for %%c in (01#,02#,03#,04#,05#,06#,07#,08#,09#,10#,11#,12#,13#,14#,15#,16#,17#,18#,19#,20#,21#,22#,23#,24#,25#,26#,27#,28#,29#,30#,31#,32#,33#,34#,35#,36#,37#,38#,39#,40#,41#,42#,43#,44#,45#,46#,47#,48#,49#,50#,51#,52#,53#,54#,55#,56#,57#,58#,59#,60#,61#,62#,63#,64#,65#,66#,67#,68#,69#,70#,71#,72#,73#,74#,75#,76#,77#,78#,79#,80#,81#) do if %machine_no%==%%c set machine_no#=1
if %machine_no#%==1 goto skip_3
:skip1
echo "现在的是:%machine_no%"
Set /p input= "请输入机台号:(01~82之间)机台号+回车键:" \
del %MachineFileName%
echo.%input%#> %MachineFileName%
goto fanhui
:skip_1
echo "你的QC机台号是%machine_no%,是否正确?"
set /p input= "正确:回车键; 错误时:(01~82之间)机台号+回车键!" \
if %input%=="" GOTO skip_2
if not %input%=="" GOTO skip2
:skip_3
echo "你输的是:%input%#机台号"
if %machine_no#%==0 set /p input= "正确:回车键; 错误时:(01~82之间)机台号+回车键!" \
set machine_no=%input%#
:: echo %machine_no%
if %machine_no#%==1 GOTO skip_2
if %input%=="" GOTO skip_2
:skip2
del %MachineFileName%
echo.%input%#> %MachineFileName%
for /f %%b in (%MachineFileName%) do set machine_no=%%b
set machine_no#=0
for %%c in (01#,02#,03#,04#,05#,06#,07#,08#,09#,10#,11#,12#,13#,14#,15#,16#,17#,18#,19#,20#,21#,22#,23#,24#,25#,26#,27#,28#,29#,30#,31#,32#,33#,34#,35#,36#,37#,38#,39#,40#,41#,42#,43#,44#,45#,46#,47#,48#,49#,50#,51#,52#,53#,54#,55#,56#,57#,58#,59#,60#,61#,62#,63#,64#,65#,66#,67#,68#,69#,70#,71#,72#,73#,74#,75#,76#,77#,78#,79#,80#,81#) do if %machine_no%==%%c set machine_no#=1
if %machine_no#%==0 goto skip_3
:skip_2
|
|