查看内网所有IP和主机名

@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 "コマンドは正常に�K了しました" /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

)

)

)

)

echo %0
 

你可能感兴趣的:(职场,主机,休闲,内网,自动获取内网IP)