root221
12-07-2011, 10:00
Нашел bat скрипт который сканирует сеть, хочу узнать, как ускорить процесс в несколько раз.
@echo off
rem 13.08.2008
if `%1`==`_` (GoTo L%2) else (
if `%1`==`` (set Base=10.10.127) else set Base=%1)
set Logs=IP_List
Echo.>>IP_List.txt
Echo IP-List of %Base%.0 at %Date% %Time:~0,8%>>IP_List.txt
Echo ==================================================>>IP_List.txt
for /L %%z in (1,1,254) do (
echo %Base%.%%z
cmd /v:on /c %0 _ 1 %Base% %%z>>IP_List.err.txt
)
GoTo End
:L1
ping -a -w 1 -n 1 %3.%4>%Temp%\IP_List-%4.tmp
if ErrorLevel 1 (del %Temp%\IP_List-%4.tmp
GoTo End)
set n=.
for /f "tokens=2 delims= " %%a in (%Temp%\IP_List-%4.tmp) do if !n!==. set n=%%a
set m=??-??-??-??-??-??
for /f "tokens=1,2 delims= " %%a in ('arp -a') do if `%%a`==`%3.%4` set m=%%b
echo %3.%4 %m% %n% >>IP_List.txt
del %Temp%\IP_List-%4.tmp
:End
exit
@echo off
rem 13.08.2008
if `%1`==`_` (GoTo L%2) else (
if `%1`==`` (set Base=10.10.127) else set Base=%1)
set Logs=IP_List
Echo.>>IP_List.txt
Echo IP-List of %Base%.0 at %Date% %Time:~0,8%>>IP_List.txt
Echo ==================================================>>IP_List.txt
for /L %%z in (1,1,254) do (
echo %Base%.%%z
cmd /v:on /c %0 _ 1 %Base% %%z>>IP_List.err.txt
)
GoTo End
:L1
ping -a -w 1 -n 1 %3.%4>%Temp%\IP_List-%4.tmp
if ErrorLevel 1 (del %Temp%\IP_List-%4.tmp
GoTo End)
set n=.
for /f "tokens=2 delims= " %%a in (%Temp%\IP_List-%4.tmp) do if !n!==. set n=%%a
set m=??-??-??-??-??-??
for /f "tokens=1,2 delims= " %%a in ('arp -a') do if `%%a`==`%3.%4` set m=%%b
echo %3.%4 %m% %n% >>IP_List.txt
del %Temp%\IP_List-%4.tmp
:End
exit