@echo off
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========
@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
)
)
)
)
pause
del %0
==============================end===================================

转载文章请注明,转载自:小马's Blog https://www.i0day.com

本文链接: https://www.i0day.com/746.html