During this time, WMIC is used to query a lot of related information on win.
But sometimes I want to find a piece of information. I don't know which alias to go to WMIC to search,
However, using list full based on relevant aliases makes it too difficult to search for information.
Therefore, I think that you can first list all aliases and redirect the output to the corresponding text file.
Then, you can search for all text files output by keyword. The text file contains all the fields and output information of the alias.
It is decided to use C to output all alias list full functions, and all aliases must be written
"Alias_1 ",
"Alias_2 ",
...
"Alias_n ",
Null
In the format of "WMIC /? "Output to copy is undoubtedly very troublesome.
The following are the processing methods:
1) Run "WMIC /? | Find "-"> "E: \ temp \ Temp"
2) Delete the first and second rows of non-alias information in temp.
3) use Notepad ++ to open temp and find many blank lines. Select "View"-"display symbol"-"Show All characters", as shown below:
Alias_1-description \ r
\ R \ n
Alias_2...
...
Open the "replace" dialog box and select "extension" in "search mode ". Replace all \ r \ n with null and empty rows to remove them.
4) Select the lookup mode to "Regular Expression", replace [^ A-Z]. * $ with ", replace ^ with", then the temp file displays the following
"Alias_1 ",
"Alias_2 ",
...
Then, Run "WMIC alias_n list full> E: \ temp \ wmic_list_full \ alias_n.txt" based on the alias array. The following is the implementation of the Program:
/* * author: xiaomu * date: 2012/03/20 */#include <stdio.h>#include <string.h>#include <stdlib.h>#define LEN 1024static char *menu[] = {"BASEBOARD","BIOS","BOOTCONFIG","CDROM","COMPUTERSYSTEM","CPU","CSPRODUCT","DATAFILE","DCOMAPP","DESKTOP","DESKTOPMONITOR","DEVICEMEMORYADDRESS","DISKDRIVE","DISKQUOTA","DMACHANNEL","ENVIRONMENT","FSDIR","GROUP","IDECONTROLLER","IRQ","JOB","LOADORDER","LOGICALDISK","LOGON","MEMCACHE","MEMLOGICAL","MEMPHYSICAL","NETCLIENT","NETLOGIN","NETPROTOCOL","NETUSE","NIC","NICCONFIG","NTDOMAIN","NTEVENT","NTEVENTLOG","ONBOARDDEVICE","OS","PAGEFILE","PAGEFILESET","PARTITION","PORT","PORTCONNECTOR","PRINTER","PRINTERCONFIG","PRINTJOB","PROCESS","PRODUCT","QFE","QUOTASETTING","RECOVEROS","REGISTRY","SCSICONTROLLER","SERVER","SERVICE","SHARE","SOFTWAREELEMENT","SOFTWAREFEATURE","SOUNDDEV","STARTUP","SYSACCOUNT","SYSDRIVER","SYSTEMENCLOSURE","SYSTEMSLOT","TAPEDRIVE","TEMPERATURE","TIMEZONE","UPS","USERACCOUNT","VOLTAGE","VOLUMEQUOTASETTING","WMISET",NULL};int wmic_list_full();int main(){wmic_list_full();return 0;}int wmic_list_full(){char **ptr;char buf[LEN];ptr = menu;while( *ptr != NULL){memset(buf, 0, LEN);sprintf(buf, "wmic %s list full > e:\\temp\\wmic_list_full\\%s.txt", *ptr, *ptr);printf("%s --- done\n", buf);*ptr ++;system(buf);}return 0;}int wmic_get_help(){char **ptr;char buf[LEN];ptr = menu;while( *ptr != NULL){memset(buf, 0, LEN);sprintf(buf, "wmic %s get /?> e:\\temp\\wmic_get_help\\%s.txt", *ptr, *ptr);printf("%s --- done\n", buf);*ptr ++;system(buf);}return 0;}
Now, you can use the "file search" function of notepad ++ to search for keywords in all output files.