请问为什么我这个批处档等待5秒之后会直接退出,而没有执行下面的指令:(
cls
cls
cls
@echo off
title .
:: 开机预留更新通道 ::
ping -n 1 10.0.0.12>nul ||goto restart
ping -n 1 10.0.0.14>nul ||goto restart
REM ====================== REM
setlocal enableextensions
echo %time%
call :ProcDelay 500
echo %time%
goto :EOF
:ProcDelay delayMSec_
setlocal enableextensions
for /f "tokens=1-4 delims=:. " %%h in ("%time%") do set start_=%%h%%i%%j%%k
:_procwaitloop
for /f "tokens=1-4 delims=:. " %%h in ("%time%") do set now_=%%h%%i%%j%%k
set /a diff_=%now_%-%start_%
if %diff_% LSS %1 goto _procwaitloop
endlocal & goto :EOF
REM ====================== REM
:EOF
IF NOT EXIST z:\ shutdown -r -t 0
copy z:\system\body.bat .\ /y
echo.
echo.
echo.
call z:\system\onerun.bat
exit
:restart
shutdown -r -t 0
1.上面3个cls 因为之后我会在ANSI档前面加入一些unicode,所以需要保留3个空行。
2.等待5秒加载网络磁盘。
3.copy z:\system\body.bat .\ /y 拷贝网络磁盘上同文件名的批处档“覆盖/更新“自己,因为以后这只批处档可能会更动内容。
4.3个echo. 怕覆盖了自己后miss 掉指令,所以放3个空的指令。
5.call 在网盘上面的批处档。
请问这样的思路有错误的地方吗?
[
Last edited by www0com0my on 2008-2-20 at 09:09 PM ]