本帖最后由 lovedjsn 于 2012-1-6 12:54 编辑
回复 9# find
感觉type有点多余加个DEL可能会好点不用麻烦最次要删除- @echo off
- setlocal enabledelayedexpansion
- set count=0
- del /f /q b.txt >nul 2>nul
- for /f "tokens=1,2" %%i in (a.txt) do (
- ping -n 1 %%i>nul
- if "!errorlevel!" neq "0" (
- >>b.txt echo,%%i %%j&&echo %%i %%j
- set /a count+=1
- )
- )
- echo ______________________________________________________________________
- echo 共有!count!个不通的
- >>b.txt echo 共有!count!个不通的
- >>b.txt echo %date% %time%
- pause >nul
复制代码
|