用我的试试,比较短小!还会写入 1.txt 内,以备查看.
经学校测试效果极佳!
不在一个工作组下的可以显示,
不在一个IP段下的不能显示.
没开机的不能显示@echo off- @echo off
- @echo 中小网络在线IP分布情况>1.txt
-
- setlocal ENABLEDELAYEDEXPANSION
-
- @FOR /F "usebackq delims=, " %%J IN (`net view /domain ^|find "命令執行成功" /v ^|find "The command completed successfully." /v ^|find "命令成功完成" /v ^|find "--" /v ^|find "Domain" /v ^|find "" /v ^|find "コマンドは正常に終了しました" /v /i`) do (
-
- @echo =====domain:%%J========>>1.txt
- @echo =====domain:%%J========
-
- @FOR /F "usebackq eol=; delims=, " %%i in (`net view /domain:%%J ^|findstr "\\"`) DO (
-
- @FOR /F "usebackq eol=; tokens=1,2,3* delims=\\" %%a in (`echo %%i`) do (
-
- @FOR /F "tokens=1,2,3,4* usebackq delims=: " %%K IN (`@ping -a -n 1 -w 100 %%a ^|findstr "Pinging"`) do (
-
- @echo \\%%L %%M>>1.txt
- @echo \\%%L %%M
-
- )
-
- )
-
- )
-
- )
-
- echo %0
- pause "按任意键退出"
复制代码 ...
mxxcgzxxx 发表于 2011-3-31 23:01
试试这个是不是更加安静简洁,呵呵- @echo off
- for /f "tokens=15" %%i in ('ipconfig ^| find /i "ip address"') do set ip=%%i
- echo %ip%
- pause
复制代码
|