什么是WMIC
WMIC是扩展WMI(Windows Management Instrumentation,Windows管理规范),提供了从命令行接口和批命令脚本执行系统管理的支持。
和上面的官方定义比起来,还有一个更好理解的解释:WMIC,是一款命令行管理工具。
使用WMIC,我们不但可以管理本地计算机,而且还可以管理同一Windows域内的所有远程计算机(需要必要的权限),而被管理的远程计算机不必事先安装WMIC,只需要支持WMI即可。
WMIC能做什么
可以使用WMIC实现如下的管理任务:
- 本地计算机管理
- 远程单个计算机管理
- 远程多个计算机管理
- 使用远程会话的计算机管理(如Telnet)
- 使用管理脚本的自动管理
WMIC使用
运行WMIC打开“开始”-“运行”栏,输入“WMIC”就可以启动wmic了。
第一次运行时,会显示WMIC正在安装,请稍等,安装完后就可以使用了。
WMIC下的命令在窗口下输入process
执行看看,列出了正在运行的进程和调用进程的路径。
当然了,我们也可以输入process list brief
来查看更详细的信息,比如进程名称、ID、优先级等。
更重要的是,对于现在有些可以在任务管理器里隐藏进程的木马,要想在wmic里隐藏,可就没那么容易了,它会成为你查杀木马的好帮手。
现在只是知道了路径,如果怀疑某一进程,想查看它的详细信息又该怎么办呢?
那输入process where name=‘xx.exe’ list full
就可以了。
我们还可以使用以下命令来杀死进程:process where name=’xx.exe’ delete
,回车后就会提示我们是否删除,这里将delete换成call terminate
也可以达到同样的效果。
在wmic下如何查看BIOS信息呢?我们输入bios list full
,很实用的命令吧,不用重启电脑就可以知道你现在使用的电脑的BIOS信息了。
除此之外,wmic还有停止、暂停和运行服务的功能:启动服务startservice
,停止服务stopservice
,暂停服务pauseservice
。
Service where caption="windows time" call stopservice #停止服务 Service where caption="windows time" call startservice #启动服务 Service where name="w32time" call stopservice #停止服务 # 注意name和caption的区别。
想要知道更多的命令,直接在命令行下输入/?
,就可以获得详细的帮助信息了。
很多人制作的批处理或者脚本功能都是调用wmi实现的,它所具有的查看功能非常强大,尤其是安装了WMIC的电脑可以连接到任何一台安装了WMI的电脑,被连接的电脑不需要安装WMIC。
比如我们要查看局域网内所有计算机的进程,监视对方计算机进程等,至于其他更多的功能就请读者自己去挖掘吧。
常用命令
- BIOS – 基本输入/输出服务 (BIOS) 管理。
- BOOTCONFIG – 启动配置管理。
- COMPUTERSYSTEM – 计算机系统管理。
- CPU – CPU 管理。DESKTOP – 用户桌面管理。
- DISKDRIVE – 物理磁盘驱动器管理。
- ENVIRONMENT – 系统环境设置管理。
- FSDIR – 文件目录系统项目管理。
- GROUP – 组帐户管理。
- JOB – 提供对使用计划服务安排的工作的访问。
- LOGON – 登录会话。
- MEMCACHE – 缓存内存管理。
- MEMLOGICAL – 系统内存管理 (配置布局和内存可用性)。
- MEMPHYSICAL – 计算机系统物理内存管理。
- NETCLIENT – 网络客户端管理。
- NNETPROTOCOL – 协议 (和其网络特点) 管理。
- NICCONFIG – 网络适配器管理。
- OS – 已安装的操作系统管理。
- PAGEFILE – 虚拟内存文件对调管理。
- PARTITION – 物理磁盘分区区域的管理。
- PROCESS – 进程管理。
- PRODUCT – 安装包任务管理。
- REGISTRY – 计算机系统注册表管理。
- SHARE – 共享资源管理。
- STARTUP – 用户登录到计算机系统时自动运行命令的管理。
- SYSACCOUNT – 系统帐户管理。
- TIMEZONE – 时间区域数据管理。
- USERACCOUNT – 用户帐户管理。
实例
系统环境变量
# 创建系统环境变量 wmic ENVIRONMENT create name="MyPath",username="<system>",VariableValue="MyValue" # 修改环境变量 wmic ENVIRONMENT where "name='MyPath' and username='<system>'" set VariableValue="ChangedValue" # 删除环境变量 wmic ENVIRONMENT where "name='MyPath'" delete
进程
# 获取进程名称以及可执行路径: wmic process get name,executablepath # 删除指定进程(根据进程名称): wmic process where name="qq.exe" call terminate # 或者 wmic process where name="qq.exe" delete # 删除指定进程(根据进程PID): wmic process where pid="123" delete # 结束可疑进程(根据进程的启动路径) wmic process where "name='explorer.exe' and executablepath<>'%SystemDrive%\\windows\\explorer.exe'" delete # 创建新进程 wmic process call create "C:\Program Files\Tencent\QQ\QQ.exe" # 在远程机器上创建新进程: wmic /node:192.168.1.10 /user:administrator /password:123456 process call create cmd.exe
计算机操作
# 关闭本地计算机 wmic process call create shutdown.exe # 重启远程计算机 wmic /node:192.168.1.10/user:administrator /password:123456 process call create "shutdown.exe -r -f -m" # 更改计算机名称 wmic computersystem where "caption='%ComputerName%'" call rename newcomputername # 更改帐户名 wmic USERACCOUNT where "name='%UserName%'" call rename newUserName # 获取物理内存 wmic memlogical get TotalPhysicalMemory|find /i /v "t" # 获取屏幕分辨率 wmic DESKTOPMONITOR where Status='ok' get ScreenHeight,ScreenWidthwmic PageFileSet set InitialSize="512",MaximumSize="512" # 查看cpu wmic cpu list brief # 查看物理内存 wmic memphysical list brief # 查看逻辑内存 wmic memlogical list brief # 查看缓存内存 wmic memcache list brief # 查看虚拟内存 wmic pagefile list brief # 查看网卡 wmic nic list brief # 查看网络协议 wmic netprotocal list brief
文件操作
获取文件的创建、访问、修改时间
@echo off for /f "skip=1 tokens=1,3,5 delims=. " %%a in ('wmic datafile where name^="c:\\windows\\system32\\notepad.exe" get CreationDate^,LastAccessed^,LastModified') do ( set a=%%a set b=%%b set c=%%c echo 文件: c:\windows\system32\notepad.exe echo.echo 创建时间: %a:~0,4% 年 %a:~4,2% 月 %a:~6,2% 日 %a:~8,2% 时 %a:~10,2% 分 %a:~12,2% 秒 echo 最后访问: %b:~0,4% 年 %b:~4,2% 月 %b:~6,2% 日 %b:~8,2% 时 %b:~10,2% 分 %b:~12,2% 秒 echo 最后修改: %c:~0,4% 年 %c:~4,2% 月 %c:~6,2% 日 %c:~8,2% 时 %c:~10,2% 分 %c:~12,2% 秒 ) echo.pause
全盘搜索某文件并获取该文件所在目录
for /f "skip=1 tokens=1*" %i in ('wmic datafile where "FileName='qq' and extension='exe'" get drive^,path') do (set "qPath=%i%j"&@echo %qPath:~0,-3%)
其他
设置虚拟内存到E盘,并删除C盘下的页面文件,重启计算机后生效
wmic PageFileSet create name="E:\\pagefile.sys",InitialSize="1024",MaximumSize="1024" wmic PageFileSet where "name='C:\\pagefile.sys'" delete
获得进程当前占用的内存和最大占用内存的大小:
wmic process where caption='filename.exe' get WorkingSetSize,PeakWorkingSetSize
以KB为单位显示
@echo off for /f "skip=1 tokens=1-2 delims= " %%a in ('wmic process where caption^="conime.exe" get WorkingSetSize^,PeakWorkingSetSize') do ( set /a m=%%a/1024 set /a mm=%%b/1024 echo 进程conime.exe现在占用内存:%m%K;最高占用内存:%mm%K ) pause
远程打开计算机远程桌面
wmic /node:%pcname% /USER:%pcaccount% PATH win32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSConnections 1
检测是否插入U盘的批处理
@echo off ((wmic logicaldisk where "drivetype=2" get name|find "无可用范例")>nul 2>nul)||for /f "skip=1 tokens=* delims=" %%i in ('wmic logicaldisk where "drivetype=2" get name') do echo U盘盘符是 %%i pause
将当前系统BIOS,CPU,主板等信息输出到一个HTML网页文件
::得到系统信息.bat,运行bat文件即可 ::系统信息输出到HTML文件,查看帮助: wmic /? ::wmic [系统参数名] list [brief|full] /format:hform >|>> [文件名] wmic bios list brief /format:hform > PCinfo.html wmic baseboard list brief /format:hform >>PCinfo.html wmic cpu list full /format:hform >>PCinfo.html wmic os list full /format:hform >>PCinfo.html wmic computersystem list brief /format:hform >>PCinfo.html wmic diskdrive list full /format:hform >>PCinfo.html wmic memlogical list full /format:hform >>PCinfo.html PCinfo.html
人若是看透了自己,
便不会小看别人。
《骆驼祥子》
——老舍
评论
Thank you for content. Area rugs and online home decor store. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Thank you for great information. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Such posts make you think about many important things that we often ignore https://r2f.ru
Nice article inspiring thanks. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Hello! I could have sworn I’ve been to this blog before but after browsing through some of the post I realized it’s new to me.Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
3. Fatigue: A major lower in power ranges and increased feelings of tiredness or exhaustion.
https://leetcode.com/u/ihbzzfwolg/
Before forming a final opinion about something, it is useful to consider different points of view https://r2f.ru
Thank you for great article. Hello Administ .Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Thank you for great information. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Great post thank you. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across.Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Great post thank you. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Thank you great posting about essential oil. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Milton Edward McCann. For welfare services to kids in Calcutta.
http://www.kold-offer.xyz/blog/1739810941137
Lawrence. The success of those tasks and the rosy promise of anthracite (a brand new surprise gasoline within the day) to alleviate energy issues spurred canal building for the subsequent decade in the east, and commercial opportunities funded three many years of funding from Illinois to the Atlantic Ocean, including the ambitious 1824 Foremost Line of Public Works bill to attach Philadelphia with the newly rising states of the Northwest Territory through the Allegheny & Ohio valleys at Pittsburgh and to Lake Erie- leveraging the huge-ranging branches of the Susquehanna River within the state’s center.
http://www.along-diq.xyz/blog/1739810975503
And Meebo lacks the breadth of options that these services and some others provide.
https://www.4shared.com/u/CEmtTQDu/dmitrijkozlovgu8229.html
Thank you for great content. Hello Administ. Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Thank you for content. Area rugs and online home decor store. Hello Administ . Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
After all, what a great site and informative posts, I will upload inbound link – bookmark this web site? Regards, Reader.Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
After all, what a great site and informative posts, I will upload inbound link – bookmark this web site? Regards, Reader.Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
EBay has the biggest industry online where every reader’s ulterior purposes are to purchase on their website.
https://pastebin.com/u/nykfbggzmfarr
https://dubllikat.ru/
Good info. Lucky me I reach on your website by accident, I bookmarked it. Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Thank you great post. Hello Administ .Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across.Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Hi, just required you to know I he added your site to my Google bookmarks due to your layout. But seriously, I believe your internet site has 1 in the freshest theme I??ve came across.Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
“I simply cannot believe this wasn’t thought by, and the ‘£1million’ sum exposes it.
http://www.ask-zt.xyz/blog/1739811004986
Here, one factor you could remember while you visit Australia on backpacking.
The term gained huge usage in the subsequent forty eight hours.
http://www.customer-jxyh.xyz/blog/1740166495288
https://leokors.ru/
Regulations identified with land continue changing in regular intervals and are frequently a noteworthy reason for head pain for the property purchasers and the dealers.
http://www.prsbz-relationship.xyz/blog/1740165949715
The Grain Futures Act (ch.
http://www.according-xh.xyz/blog/1740201873737
The most important thing that you can do is get a better and expert retirement planner and then start your management properly with it.
https://pbase.com/axJbIHOmdj
Thank you great post. Hello Administ .Seo Paketi Skype: By_uMuT@KRaLBenim.Com -_- live:by_umut
Nxe4 21.fxe4 Bxd4 22.Rxd4 Rf2 23.e5 Bb5 gives Black strong counterplay.
http://www.gzwf-market.xyz/blog/1740296229722
A sister ship, Carnival Triumph, launched in 1999 and was adopted by Carnival Victory in 2000.
https://gdfjdfgh.blogspot.com/2025/02/zndyvxivcu.html
Major Gordon Muir (514210), Small Arms School Corps.
http://www.gas-owsoz.xyz/blog/1740296741157
275066 129658Youd superb suggestions there. I did a research about the concern and identified that likely almost anyone will agree along with your web page. 948248
The game of the Century featured a windmill involving a knight and a bishop.
http://www.jh-finish.xyz/blog/1740296194121
тур в чужой город может быть увлекательным, но иногда вызывает беспокойство, особенно когда нужно определиться с такси. Чтобы избежать проблем, важно знать несколько полезных правил. Всегда используйте официальные сервисы заказа такси, такие как Uber или местные приложения. Это гарантирует ясные тарифы и безопасность https://tratatur.ru/price/taxi-tuapse-loo
. Перед поездочкой ознакомьтесь с комментариями о компании и уточните цену поездки. Обязательно проверьте наличие лицензии у professional-водителя и состояние автомобиля. Если у вас возникнут подозрения, лучше прекратить от поездки. Следуя этим рекомендациям, вы сможете полюбоваться путешествием без ненужных забот.
Привет, друзья!
Всегда считал, что покупка диплома о высшем образовании — это миф и невозможно. Но, к счастью, оказался неправ. Сначала искал информацию по теме: купить диплом в магадане, , , , , а затем переключился на дипломы вузов. Подробности здесь: http://fethtnyjm.com\doc\sob-3-3
Оказалось, что все реально и легально, со специальными условиями и упрощенными программами. Теперь у меня диплом московского вуза нового образца, что я настоятельно рекомендую и вам!|
Completely not, besides that one factor.
https://fairygodboss.com/users/profile/R7LCIuC36B/Seasonal-decor-ideas
Unlike your automobile battery, which is a shallow-cycle battery, deep-cycle batteries can discharge extra of their stored energy while nonetheless sustaining lengthy life.
http://www.member-we.xyz/blog/1740296382467
подбор надежного такси в Анапе особенно критичен для гостей и резидентских жителей. Прежде всего, обратите внимание на законных службах с разрешением.
https://tratatur.ru/price/taxi-anapa-alupka
Хорошее такси должно предлагать фиксированные тарифы, 24/7 поддержку и опцию безналичной оплаты. Изучайте оценки о компании, убедитесь в качестве автомобиля и вежливости водителя.
В Анапе известны службы “Анапское такси”, “Яндекс.Такси” и “Убер”. Не предпочитайте выбирая слишком дешевые варианты – это может быть небезопасно.
It is an effective way to realize insight into the assorted features of life and make decisions.
http://www.think-xstux.xyz/blog/1740460008469
Shortly the monks work to cover the holiest of artifacts, to mount some form of protection, but the Vikings hit the shore with beautiful speed.
http://www.several-du.xyz/blog/1740462421210
891428 138058I respect your piece of function, appreciate it for all the interesting content . 828474
In the 1850s, the image of the west was influenced largely by the British authorities.
http://www.dpse-poor.xyz/blog/1740560893825
Cadillac contributed a dashboard that was tailored and narrowed, the steering column, four-wheel disc brakes, and more.
https://git.iws.uni-stuttgart.de/jfgswyx
For a handsome lodge look, elegant pure supplies — heirloom wood furniture, slate, and stone flooring — create a fuss-free basis for an outdoorsy, elegant life-style.
http://www.wrwrt-someone.xyz/blog/1740561595487
Even so, keep away from water flow and drainage as well as water flow and drainage obvious discovering places and provide help from the mouse deal with the program to obtain a way more efficient substitute for mouse course.
http://www.customer-jxyh.xyz/blog/1740560083448