[ Last edited by lililulula on 2007-4-20 at 03:55 PM ]作者: lililulula 时间: 2007-4-14 05:34 搞懂了 这里编辑掉~~~
[ Last edited by lililulula on 2007-4-20 at 03:55 PM ]作者: leton 时间: 2007-4-20 12:20 终于有空继续了.....最近忙死了,那位兄弟看完麻烦指点一下,让代码更合理,简短,强大;谢谢
@echo off
:Begin
copy nul power.txt
copy nul server.txt
Set time=""
for /f "tokens=1 delims=; " %%a in ('time /t') do Set time=%%a
If %time% LSS 18:00 ( goto go ) else ( exit )
:go
for /L %%A in (1,10,60) do ping -n 1 -l 16 -w 100 192.168.200.%%A | find "Reply" >> power.txt
for %%C in (power.txt) do @if "%%~za"=="0" goto shutdown
goto time
:time
timeout 180
goto begin
:shutdown
for /L %%B in (1,1,10) do ping -n 1 -l 16 -w 100 192.168.200.%%B | find "Reply" >> server.txt
for /F " tokens=12,3 delims=: " %%B in (server.txt) do call shutdown -m \\%%B -f -s -t 120
goto end
:end作者: leton 时间: 2007-7-7 17:09 ...有问题。一直没发现
:go
for /L %%A in (1,10,60) do ping -n 1 -l 16 -w 100 192.168.200.%%A | find "Reply" >> power.txt
for %%C in (power.txt) do @if "%%~za"=="0" goto shutdown
goto time
:time
timeout 180
goto begin
:shutdown
for /L %%B in (1,1,10) do ping -n 1 -l 16 -w 100 192.168.200.%%B | find "Reply" >> server.txt
for /F " tokens=12,3 delims=: " %%B in (server.txt) do call shutdown -m \\%%B -f -s -t 120
goto end