优秀的编程知识分享平台

网站首页 > 技术文章 正文

WMIC命令使用详解(四)(wc命令的作用是什么)

nanyue 2024-08-16 00:37:48 技术文章 8 ℃

连接远程电脑

★★连接远程的电脑,不过好像对要开一些相应的服务

wmic /node:"192.168.203.131" /password:"" /user:"administrator"


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

★★查看bios版本型号

wmic bios get Manufacturer,Name


WMIC设置IP地址

★★配置或更新IP地址:

wmic nicconfig where index=0 call enablestatic("192.168.1.5"), ("255.255.255.0") ;index=0说明是配置网络接口1。


配置网关(默认路由):

wmic nicconfig where index=0 call setgateways("192.168.1.1"),(1)

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'" call joindomainorworkgroup "","","MyGroup",1


CPU - CPU 管理

★★查看cpu型号

wmic cpu get name


DATAFILE - DataFile 管理

★★查找e盘下test目录(不包括子目录)下的cc.cmd文件

wmic datafile where "drive='e:' and path='\\test\\' and FileName='cc' and Extension='cmd'" list

★★查找e盘下所有目录和子目录下的cc.cmd文件,且文件大小大于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>'10000000'" call delete

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

wmic datafile where "drive='e:' and Extension<>'cmd' and path='test'" call delete

★★复制e盘下test目录(不包括子目录)下的cc.cmd文件到e:\,并改名为aa.bat

wmic datafile where "drive='e:' and path='\\test\\' and FileName='cc' and Extension='cmd'" call copy "e:\aa.bat"

★★改名c:\hello.txt为c:\test.txt

wmic datafile "c:\\hello.txt" call rename c:\test.txt

★★查找h盘下目录含有test,文件名含有perl,后缀为txt的文件

wmic datafile where "drive='h:' and extension='txt' and path like '%\\test\\%' and filename like '%perl%'" get name


DESKTOPMONITOR - 监视器管理

★★获取屏幕分辨率

wmic DESKTOPMONITOR where Status='ok' get ScreenHeight,ScreenWidth

DISKDRIVE - 物理磁盘驱动器管理

★★获取物理磁盘型号大小等

wmic DISKDRIVE get Caption,size,InterfaceType


ENVIRONMENT - 系统环境设置管理

★★获取temp环境变量

wmic ENVIRONMENT where "name='temp'" get UserName,VariableValue

★★更改path环境变量值,新增e:\tools

wmic ENVIRONMENT where "name='path' and username='<system>'" set VariableValue="%path%;e:\tools"

★★新增系统环境变量home,值为%HOMEDRIVE%%HOMEPATH%

wmic ENVIRONMENT create name="home",username="<system>",VariableValue="%HOMEDRIVE%%HOMEPATH%"

★★删除home环境变量

wmic ENVIRONMENT where "name='home'" delete


FSDIR - 文件目录系统项目管理

★★查找e盘下名为test的目录

wmic FSDIR where "drive='e:' and filename='test'" list

★★删除e:\test目录下除过目录abc的所有目录

wmic FSDIR where "drive='e:' and path='\\test\\' and filename<>'abc'" call delete

★★删除c:\good文件夹

wmic fsdir "c:\\good" call delete

★★重命名c:\good文件夹为abb

wmic fsdir "c:\\good" rename "c:\abb"


LOGICALDISK - 本地储存设备管理

★★获取硬盘系统格式、总大小、可用空间等

wmic LOGICALDISK get name,Description,filesystem,size,freespace

★★查看当前系统打了哪些补丁

/node:legacyhost qfe get hotfixid

查看CPU当前的速度

★★cpu当前的速度

wmic cpu get CurrentClockSpeed


未完待续...

最近发表
标签列表