标题: [求助]如何用WMIC查找指定文件?
[打印本页]
作者: lxmxn
时间: 2006-12-10 13:33
标题: [求助]如何用WMIC查找指定文件?
由于正在学习WMIC的用法,对于WMIC的很多用法都不知道,所以现在单独发一个求助帖,请大家帮忙。
请教一下,如何用WMIC查找指定的文件呢?比如我要查找F盘lxmxn\cn-dos目录下的lxmxn.vbs文件,用WMIC命令是什么呢?如果我想将查找的结果保存到一个html文件中,格式又是怎么写呢?
作者: 3742668
时间: 2006-12-10 14:49
wmic datafile where "name='f:\\lxmxn\cn-dos\\lxmxn.vbs'" list
作者: lxmxn
时间: 2006-12-10 15:19
Quote: |
Originally posted by 3742668 at 2006-12-10 14:49:
wmic datafile where "name='f:\\lxmxn\cn-dos\\lxmxn.vbs'" list |
|
版主这里的"f:\\lxmxn\cn-dos\\lxmxn.vbs"中间的"\"少了一个,应该是"\\"就可以找到了。
作者: a9319751
时间: 2006-12-11 05:47
WMIC的教程那里有个,给提供个,俺也想学习啊
作者: lxmxn
时间: 2006-12-11 06:41
我用的教程是:
hh wmic.chm
作者: a9319751
时间: 2006-12-11 06:44
汗,该页无法显示,真晕
不能打开文件 wmic.chm
作者: 3742668
时间: 2006-12-11 07:00
直接wmic /?就足够了。
没看清主题的要求,关于输出为网页格式:
@echo off
rem 文件名处理:
set "file=d:\a.html"
set "file=%file:\=\\%"
rem 输出重定向
set "outFile=out.html"
rem 如果想把结果保存到剪贴板,则把outfile设置为下面的值
rem set "outFile=CLIPBOARD"
rem 输出格式:
set "fileType=htable"
wmic /output:%outFile% datafile where "name='%file%'" list /format:%fileType%
exit /b 0
作者: redtek
时间: 2006-12-11 07:08
精彩!!!
版主堪称一代批魔啊~~~
(注释:批--代表批处理~:D)
作者: lxmxn
时间: 2006-12-11 08:12
谢谢版主。还有问题,这个format后面的格式到底是怎么定义的,类似htable的格式还有哪些?帮助里面没有找到相关的提要。
作者: 3742668
时间: 2006-12-11 08:27
Quote: |
Originally posted by lxmxn at 2006-12-11 08:12:
谢谢版主。还有问题,这个format后面的格式到底是怎么定义的,类似htable的格式还有哪些?帮助里面没有找到相关的提要。 |
|
老同志了,该好好看看wmic /?。
Quote: |
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 |
|
作者: lxmxn
时间: 2006-12-11 14:15
用WMIC PROCESS LIST FULL列出所有进程的信息时,默认是以processid来排序的,能不能以name来排序呢?
作者: mobo
时间: 2006-12-29 07:47
标题: 你还可以改成带表格的网页显示它
可以这样下命令,产生的文本文件收拾一下就有了:
H:\>wmic process get name >tmp.txt && sort < tmp.txt >out.txt
--------墨伯,于2006-12-27
作者: mobo
时间: 2006-12-29 07:52
标题: 我提供一些学习范例吧,希望大家会喜欢---墨伯
::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
---------------------收集,整理,改编:墨伯MOBO,于2006-12-27
作者: xycoordinate
时间: 2007-3-1 00:10
E:\>WMIC USERACCOUNT WHERE "Name='administrator' AND Domain= " > USERACCOUNT.txt
节点 - MS080514
错误:
代码 = 0x80041017
说明 = 无效查询
设备 = 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 管理计算机(域)的内置帐户 FALSE MS08051
4 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 ]
作者: zyz0304360
时间: 2008-2-23 10:41
支持一下
我操作系统非中文
同情我一下