2024年5月24日发(作者:)

14.Wmic使用指南

BIOS – 基本输入/输出服务 (BIOS) 管理

::查看bios版本型号

wmic bios get Manufacturer,Name

COMPUTERSYSTEM – 计算机系统管理

::查看系统启动选项,boot的内容

wmic COMPUTERSYSTEM get SystemStartupOptions

::查看工作组/域

wmic computersystem get domain

::更改计算机名abc为123

wmic computersystem where “name=’abc’” call rename 123

::更改工作组google为MyGroup

wmic computersystem where “name=’google’”

joindomainorworkgroup “”,”",”MyGroup”,1

call

CPU – CPU 管理

::查看cpu型号

wmic cpu get name

DATAFILE – DataFile 管理

::查找e盘下test目录(不包括子目录)下的文件

wmic datafile where “drive=’e:’ and path=’test’ and

FileName=’cc’ and Extension=’cmd’” list

::查找e盘下所有目录和子目录下的文件,且文件大小大于1K

wmic datafile where “drive=’e:’ and FileName=’cc’ and Extension=’

cmd’ and FileSize>’1000′” list

::删除e盘下文件大小大于10M的.cmd文件

wmic datafile where “drive=’e:’ and Extension=’cmd’ and FileSize>’′”

call delete

::删除e盘下test目录(不包括子目录)下的非.cmd文件

wmic datafile where “drive=’e:’ and Extension<>’cmd’ and