整理一下資料,有需要的人可以參考看看,
PS:
1.用較笨的方法,解決問題,如有可改進的地方,還請大家不吝指教 ^^
2.請準備ipscan210.exe ,版本不用太新,因公司內部使用officescan 10,ipscan太新會認定是有問題的檔案 ...
http://sourceforge.net/projects/ipsc...pscan2-binary/
3.Unixutil
http://unxutils.sourceforge.net/
ipscan.cmd 內部如下:
@echo off
cls
set log_path=c:\ipscan\ping_log
rem 取得當下的時間(年、月、日)
set /a year=%date:~,4%
set month=%date:~5,2%
set day=%date:~8,2%
set hh=%time:~,2%
set mm=%time:~3,2%
set ss=%time:~6,2%
set mydate=%year%.%month%.%day%-%hh%.%mm%
set mytime=%month%.%day%-%hh%.%mm%
set mydate1=%year%.%month%.%day%
ipscan210 -h -s 172.16.1.1 172.16.1.254 1-%mytime%.1.txt
ipscan210 -h -s 172.16.2.1 172.16.2.254 2-%mytime%.1.txt
ipscan210 -h -s 172.16.3.1 172.16.3.254 3-%mytime%.1.txt
ipscan210 -h -s 172.16.4.1 172.16.4.254 4-%mytime%.1.txt
ipscan210 -h -s 172.16.5.1 172.16.5.254 5-%mytime%.1.txt
ipscan210 -h -s 172.16.6.1 172.16.6.254 6-%mytime%.1.txt
ipscan210 -h -s 172.16.7.1 172.16.7.254 7-%mytime%.1.txt
for %%f in (*.txt) do (type %%f | grep "ms" | gawk "{print $1,$4}" >>%%f.2.txt)
if not exist %log_path%\%mydate1% (mkdir %log_path%\%mydate1%)
move /y *.txt %log_path%\%mydate1%
move /y *.log %log_path%\%mydate1%
pause > nul
@echo off
書籤