- @echo off & setlocal enableDelayedExpansion
- rem Ping Tool for En Windows OS
- For /f "tokens=2*" %%a IN ('reg query "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders" /v Desktop') DO Set "Desktop=%%b"
- For /f "delims=*" %%i IN ('Call echo %Desktop%') do set Desktop=%%i
- set ip=
- set /p ip=Input WebSit Addres:
- ping %ip% >%Desktop%\a.txt
- findstr /b /i /c:"Ping statistics" /c:" Packets:" /c:" Minimum" %Desktop%\a.txt>%Desktop%\b.txt
- set file=%Desktop%\b.txt
- set "file=%file:"=%"
- for %%i in ("%file%") do set file=%%~fi
- set replaced=
- set all=
- for /f "delims=" %%i in ('type "%file%"') do (
- set str=%%i
- set "str=!str:%replaced%=%all%!"
- echo !str!>>%Desktop%\IP.txt
- )
- DEL /F /Q %Desktop%\a.txt
- DEL /F /Q %Desktop%\b.txt
- start %Desktop%\IP.txt
- EXIT
复制代码
[ 本帖最后由 andyrave 于 2011-1-22 08:27 编辑 ] |