Reputation: 55
I want to know the all of the valid clauses behind where keyword about wmic command.
Wmic nicconfig where DefaultIPGateway!='' get description
The above command sentence show me an error message description = invalid query
I suspect that the DefaultIPGateway
is not a valid clause. So how to get the all of the valid clauses behind the where keyword.
I did the following tries.
Wmic alias get pwhere
Upvotes: 2
Views: 3946
Reputation: 30123
Full list of the WQL keywords: WQL (SQL for WMI).
Win32_NetworkAdapterConfiguration class:
DefaultIPGateway
Data type:
string array
Access type: Read-only
Qualifiers: MappingStrings ("Win32Registry|System\CurrentControlSet\Services|Parameters|DefaultGateway")Array of IP addresses of default gateways that the computer system uses.
The WMI Query Language (WQL) is a subset of standard American National Standards Institute Structured Query Language (ANSI SQL) with minor semantic changes to support WMI.
…
Note WQL does not support queries of
array
datatypes.
Corollary: you cannot constitute a valid WHERE
clause to narrow the wmic
output by DefaultIPGateway
data.
Please read http://ss64.com/nt/wmic.html to see some valid WHERE
clause examples used in wmic
command.
However, you can still get desired info using find
or findstr
commands, for instance as follows:
==> Wmic nicconfig get DefaultIPGateway, description | find "{"
{"192.168.11.1"} Realtek PCIe GBE Family Controller
Upvotes: 1