首页 技术 正文
技术 2022年11月14日
0 收藏 596 点赞 4,360 浏览 2228 个字

WQL就是英文WMI Query Language的缩写,就是说wmic这个命令支持简单的一些SQL查询,我们以实例来讲解他的部分用法,这个命令过于强大,因此以下只是该命令的冰山一角。

列出本地连接的简要信息

C:\>wmic nicconfig list brief
DefaultIPGateway Description DHCPEnabled DNSDomain Index IPAddress ServiceName
Microsoft Kernel Debug Network Adapter TRUE 0 kdnic
{“192.168.3.1”} Intel(R) Wireless-N 7265 TRUE 1 {“192.168.3.227”} Netwtw04
Intel(R) Ethernet Connection (3) I218-LM TRUE 2 e1iexpress
Microsoft Wi-Fi Direct Virtual Adapter TRUE 3 vwifimp
Microsoft ISATAP Adapter FALSE 4 tunnel
Microsoft Teredo Tunneling Adapter FALSE 5 tunnel
Bluetooth Device (RFCOMM Protocol TDI) FALSE 6 RFCOMM
Bluetooth Device (Personal Area Network) TRUE 7 BthPan
TAP-Win32 Adapter V9 TRUE 8 {“2.0.1.4”} tap0901
TAP-Win32 Adapter V9 TRUE 10 tap0901
Microsoft ISATAP Adapter FALSE 11 tunnel
Microsoft 6to4 Adapter FALSE 12 tunnel
VMware Virtual Ethernet Adapter for VMnet1 FALSE 13 {“192.168.246.1”} VMnetAdapter
Microsoft ISATAP Adapter FALSE 14 tunnel
VMware Virtual Ethernet Adapter for VMnet8 FALSE 15 {“192.168.47.1”} VMnetAdapter
Microsoft ISATAP Adapter FALSE 16 tunnel
Microsoft ISATAP Adapter FALSE 17 tunnel

承上,列出IP地址是通过DHCP获取的本地连接简要信息

C:\>wmic nicconfig where DHCPEnabled=’TRUE’ list brief
DefaultIPGateway Description DHCPEnabled DNSDomain Index IPAddress ServiceName
Microsoft Kernel Debug Network Adapter TRUE 0 kdnic
{“192.168.3.1”} Intel(R) Wireless-N 7265 TRUE 1 {“192.168.3.227”} Netwtw04
Intel(R) Ethernet Connection (3) I218-LM TRUE 2 e1iexpress
Microsoft Wi-Fi Direct Virtual Adapter TRUE 3 vwifimp
Bluetooth Device (Personal Area Network) TRUE 7 BthPan
TAP-Win32 Adapter V9 TRUE 8 {“2.0.1.4”} tap0901
TAP-Win32 Adapter V9 TRUE 10 tap0901

承上,列出本地连接显示已连接的本地连接简要信息,而不是已断开的本地连接

C:\>wmic nicconfig where (DHCPEnabled=’TRUE’ and IPEnabled=’TRUE’) list brief
DefaultIPGateway Description DHCPEnabled DNSDomain Index IPAddress ServiceName
{“192.168.3.1”} Intel(R) Wireless-N 7265 TRUE 1 {“192.168.3.227”} Netwtw04
TAP-Win32 Adapter V9 TRUE 8 {“2.0.1.4”} tap0901

承上,列出描述信息不带win32字样的本地连接简要信息

C:\>wmic nicconfig where (DHCPEnabled=’TRUE’ and IPEnabled=’TRUE’ and not Description like ‘%win32%’) list brief
DefaultIPGateway Description DHCPEnabled DNSDomain Index IPAddress ServiceName
{“192.168.3.1”} Intel(R) Wireless-N 7265 TRUE 1 {“192.168.3.227”} Netwtw04

承上,我只要列出IP地址和网关,其他的不要

C:\>wmic nicconfig where (DHCPEnabled=’TRUE’ and IPEnabled=’TRUE’ and not Description like ‘%win32%’) get IPAddress,DefaultIPGateway
DefaultIPGateway IPAddress
{“192.168.3.1”} {“192.168.3.227”}

小朋友们,你们都学会了吗?我们再来一遍吧!!!

技术交流群:70539804

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,493
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295