中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-15 12:59
47,812 topics / 349,917 posts / today 0 new / 48,268 members
DOS批处理 & 脚本技术(批处理室) » [Help] How to use WMIC to find a specified file?
Printable Version  4,195 / 14
Floor1 lxmxn Posted 2006-12-10 13:33
版主 Posts 4,938 Credits 11,386

  Since I am learning how to use WMIC and don't know many of its usages, I am now separately posting a help request. Please help me.

  May I ask, how to use WMIC to find a specified file? For example, I want to find the lxmxn.vbs file in the lxmxn\cn-dos directory on drive F. What is the WMIC command? If I want to save the search result to an html file, how is the format written?
Floor2 3742668 Posted 2006-12-10 14:49
荣誉版主 Posts 718 Credits 2,013
```
wmic datafile where "name='f:\\lxmxn\cn-dos\\lxmxn.vbs'" list
```
Floor3 lxmxn Posted 2006-12-10 15:19
版主 Posts 4,938 Credits 11,386
Originally posted by 3742668 at 2006-12-10 14:49:


  The moderator here, the "f:\\lxmxn\cn-dos\\lxmxn.vbs" has one less "\", it should be "\\\" to find it.
Floor4 a9319751 Posted 2006-12-11 05:47
中级用户 Posts 170 Credits 439
Where can I find a tutorial on WMIC? Please provide one. I also want to learn it.
Floor5 lxmxn Posted 2006-12-11 06:41
版主 Posts 4,938 Credits 11,386

  The tutorial I used is:
Floor6 a9319751 Posted 2006-12-11 06:44
中级用户 Posts 170 Credits 439
Swe sweat, this page cannot be displayed, really dizzy

Cannot open file wmic.chm
Floor7 3742668 Posted 2006-12-11 07:00
荣誉版主 Posts 718 Credits 2,013
Just using `wmic /?` is sufficient.

Didn't see the requirements for the topic clearly. Regarding outputting in web page format:

Floor8 redtek Posted 2006-12-11 07:08
金牌会员 Posts 1,147 Credits 2,902
Wonderful!!!
The moderator can be called a generation of batch processing masters~~~

(Note: Batch - represents batch processing~: D)
Floor9 lxmxn Posted 2006-12-11 08:12
版主 Posts 4,938 Credits 11,386

  Thanks moderator. There is still a question, how exactly is the format defined after format? What are other formats similar to htable? I can't find relevant information in the help.
Floor10 3742668 Posted 2006-12-11 08:27
荣誉版主 Posts 718 Credits 2,013
Originally posted by lxmxn at 2006-12-11 08:12:

  Thank you, moderator. There is another question. How exactly is the format defined after format? What are the other formats similar to htable? I can't find relevant details in the help.

Old comrade, you should take a good look at wmic /?.
CSV
HFORM
HMOF
HTABLE
HXML
LIST
TABLE
VALUE
htable-sortby
htable-sortby.xsl
texttablewsys
texttablewsys.xsl
wmiclimofformat
wmiclimofformat.xsl
wmiclitableformat
wmiclitableformat.xsl
wmiclitableformatnosys
wmiclitableformatnosys.xsl
wmiclivalueformat
wmiclivalueformat.xsl
Floor11 lxmxn Posted 2006-12-11 14:15
版主 Posts 4,938 Credits 11,386

When listing all process information with `WMIC PROCESS LIST FULL`, it is sorted by processid by default. Can it be sorted by name?
Floor12 mobo Posted 2006-12-29 07:47
初级用户 Posts 30 Credits 73
You can issue the command like this, and after tidying up the generated text file, it will be ready:
H:\>wmic process get name >tmp.txt && sort < tmp.txt >out.txt
--------Mo Bo, on 2006-12-27
Floor13 mobo Posted 2006-12-29 07:52
初级用户 Posts 30 Credits 73
::WMIC DATAFILE WHERE "Drive='C:' AND Extension='vbs'" GET Caption,CSName > DATAFILE.txt
WMIC DESKTOP WHERE "Name='new'" GET Name,ScreenSaverExecutable,ScreenSaverSecure,ScreenSaverTimeout,Wallpaper > DESKTOP.txt
WMIC DISKQUOTA WHERE "Limit >'10000'" > DISKQUOTA.txt
::WMIC FSDIR WHERE "Path='\\Windows\\'" GET CSName,Compressed,EightDotThreeFileName,Encrypted,Hidden,Writeable > FSDIR.txt
WMIC GROUP WHERE "Name='daode'" > GROUP.txt
WMIC JOB GET Command,RunRepeatedly,StartTime > JOB.txt
WMIC LOADORDER GET Name,GroupOrder /format:csv > LOADORDER.txt
::WMIC LOGICALDISK WHERE "DriveType='3' OR DriveType='4'" GET Caption,FreeSpace,ProviderName,Size,SystemName,FileSystem > LOGICALDISK.txt
WMIC MemLogical GET /FORMAT:CSV > MemLogical.txt
WMIC NETUSE GET Name,Status,UserName > NETUSE.txt
--WMIC PAGEFILESET WHERE "Name= 'C:\\pagefile.sys' SET InitialSize='500',MaximumSize='600'"
WMIC PRINTJOB GET Document,Name,Owner,PagesPrinted,Status,TimeSubmitted,TotalPages,Size,JobStatus,JobId > PRINTJOB.txt
::WMIC PROCESS WHERE "WorkingSetSize>'1000000'" GET Caption,CSName,ExecutablePath,ParentProcessId,ProcessId,WorkingSetSize > PROCESS.txt
WMIC QUOTASETTING LIST > QUOTASETTING.txt
--WMIC RDACCOUNT GET AccountName,PermissionsAllowed,PermissionsDenied > RDACCOUNT.txt
--WMIC RDNIC GET NetworkAdapterName,TerminalName > RDNIC.txt
--WMIC RDPERMISSIONS LIST > RDPERMISSIONS.txt
::WMIC RDTOGGLE WHERE "AllowTSConnections='1'" CALL SetAllowTSConnections 0
WMIC SCSICONTROLLER GET DriverName,Manufacturer,Name,Status,Systemname > SCSICONTROLLER.txt
WMIC TAPEDRIVE GET Compression,Description,Name,Status > TAPEDRIVE.txt
WMIC TEMPERATURE GET CurrentReading,Description,MaxReadable,MinReadable,Resolution > TEMPERATURE.txt
WMIC UPS GET FirstMessageDelay,LowBatterySignal,MessageInterval,RemainingCapacityStatus,UPSPort > UPS.txt
WMIC USERACCOUNT WHERE "Name='daode' AND Domain= " > USERACCOUNT.txt
--WMIC VOLTAGE GET Accuracy,CurrentReading,Description,MaxReadable,Resolution > VOLTAGE.txt
WMIC VOLUMEQUOTASETTING LIST > VOLUMEQUOTASETTING.txt
---------------------Collected, organized, adapted: Mobro MOBO, on 2006-12-27
Floor14 xycoordinate Posted 2007-03-01 00:10
中级用户 Posts 228 Credits 493 From 安徽
E:\>WMIC USERACCOUNT WHERE "Name='administrator' AND Domain= " > USERACCOUNT.txt

Node - MS080514
Error:
Code = 0x80041017
Description = Invalid query
Device = WMI



E:\>WMIC USERACCOUNT WHERE(Name="administrator") >USERACCOUNT.txt

E:\>type USERACCOUNT.txt
AccountType Caption Description Disabled Domain
FullName InstallDate LocalAccount Lockout Name PasswordChangeab
le PasswordExpires PasswordRequired SID
SIDType Status
512 MS180418\administrator Built-in account for adminis
tering the computer/domain FALSE MS080514 TRUE FALSE administrator TRUE
FALSE TRUE S-1-5-21-1185841169-742266776-3604767735-
500 1 OK

[ Last edited by xycoordinate on 2007-2-28 at 11:22 AM ]
Floor15 zyz0304360 Posted 2008-02-23 10:41
中级用户 Posts 123 Credits 257 From 烟台
Support me
My operating system is not in Chinese
Have pity on me
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023