if "%~1"=="" start /min "" "%~0" h&exit
有一个批处理第一句就是这个我看了半天看不懂,
@echo off
for /f "delims=: tokens=1*" %%i in ('time /t') do call :Comp %%i %%j
goto :eof
:Comp
set /a Hour=%1
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 01 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 02 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 03 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 04 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 05 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 06 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 07 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 13 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 14 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 15 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 16 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 17 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 23 (d:\ntsd\shutdown.exe & goto :eof)
shutdown.exe是一个关机程序
这里面的能不能简化下,,IF我到现在没找到这样的语名,,大于且小于,,
不然就不会用这个笨方法了
也就4楼说的那样,早上8:00-12:00,晚上18:00-22:00可以运行,其他时间都关机
这个批处理怎么写比较简单!
[ Last edited by zhaoyi on 2008-10-28 at 23:28 ]
有一个批处理第一句就是这个我看了半天看不懂,
@echo off
for /f "delims=: tokens=1*" %%i in ('time /t') do call :Comp %%i %%j
goto :eof
:Comp
set /a Hour=%1
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 01 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 02 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 03 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 04 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 05 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 06 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 07 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 13 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 14 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 15 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 16 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 17 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 00 (d:\ntsd\shutdown.exe & goto :eof)
if %Hour% equ 23 (d:\ntsd\shutdown.exe & goto :eof)
shutdown.exe是一个关机程序
这里面的能不能简化下,,IF我到现在没找到这样的语名,,大于且小于,,
不然就不会用这个笨方法了
也就4楼说的那样,早上8:00-12:00,晚上18:00-22:00可以运行,其他时间都关机
这个批处理怎么写比较简单!
[ Last edited by zhaoyi on 2008-10-28 at 23:28 ]


我是超菜菜鸟