[研究][BAT]顯示本機IPv4值
2024-03-31
環境:Windows 10
********************************************************************************
NetworkIP.bat
FOR /F "tokens=2 delims=[]" %%a in ('ping -4 -n 1 %computername% ^| findstr [') do set NetworkIP=%%a echo %NetworkIP% |
NetworkIP2.bat (用 @ECHO OFF 關閉顯示執行的每道命令)
@ECHO OFF FOR /F "tokens=2 delims=[]" %%a in ('ping -4 -n 1 %computername% ^| findstr [') do set NetworkIP=%%a echo %NetworkIP% |
show_ipv4.bat
@rem show_ipv4.bat @echo off for /f "tokens=2 delims=:" %%i in ('ipconfig ^| findstr IPv4') do ( echo IPv4: %%i ) pause |
(完)
相關
沒有留言:
張貼留言