[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
  1. (
  2. ipconfig
  3. wmic nicconfig where "IPEnabled=true" get *|more
  4. wmic nic where "NetEnabled=true" get *|more
  5. )>result.txt&pause
复制代码
把生成的result.txt文件打包上传看看

TOP

回复 3# googlegg

用bat和vbs两种格式保存运行不就知道了

TOP

  1. @echo off
  2. rem 猜的。win7以上系统运行
  3. set "file=ip记录.txt"
  4. if not exist "%file%" cd.>"%file%"
  5. for /f %%a in ('powershell -c "([System.Net.NetworkInformation.NetworkInterface]::GetAllNetworkInterfaces()|?{$_.NetworkInterfaceType -eq 'Ppp'}).GetIPProperties().UnicastAddresses[0].Address.ToString()" 2^>nul') do set "ip=%%a"
  6. if defined ip (
  7.     >nul findstr "^%ip:.=\.%$" "%file%"||powershell -c "(,'%ip%')+(gc '%file%')|sort {$a=$_.split('.');'{0:d3}{1:d3}{2:d3}{3:d3}' -f [int]$a[0],[int]$a[1],[int]$a[2],[int]$a[3]}|out-file '%file%' -encoding default" 2>nul
  8. )
  9. pause
复制代码

TOP

返回列表