{"id":256,"date":"2014-06-29T10:30:40","date_gmt":"2014-06-29T10:30:40","guid":{"rendered":"http:\/\/ixyzero.com\/blog\/?p=256"},"modified":"2014-06-29T10:30:40","modified_gmt":"2014-06-29T10:30:40","slug":"256","status":"publish","type":"post","link":"https:\/\/ixyzero.com\/blog\/archives\/256.html","title":{"rendered":"WMIC\u547d\u4ee4\u6574\u7406"},"content":{"rendered":"<p>WMIC\u547d\u4ee4\u5728\u6211\u4eec\u7684\u5de5\u4f5c\u4e2d\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u51cf\u5c11\u5bf9\u5176\u4ed6\u5de5\u5177\u7684\u4f9d\u8d56\u5e76\u8282\u7701\u6211\u4eec\u7684\u65f6\u95f4\uff0c\u503c\u5f97\u5b66\u4e60\u3002<br \/>\n\u547d\u4ee4\u5f88\u591a\uff0c\u4e0b\u9762\u662f\u4ece\u7f51\u4e0a\u627e\u5230\u7684\u8f83\u5b9e\u7528\u7684\u4e00\u4e9b\u547d\u4ee4\u3002<\/p>\n<p>\u53ef\u4ee5\u53c2\u8003\u5fae\u8f6f\u7684\u4e00\u4e2a\u5e2e\u52a9\u9875\u9762\uff1a<br \/>\n<a href=\"http:\/\/technet.microsoft.com\/zh-cn\/library\/cc779482(WS.10).aspx\" target=\"_blank\">http:\/\/technet.microsoft.com\/zh-cn\/library\/cc779482(WS.10).aspx<\/a><\/p>\n<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<\/p>\n<p>\u83b7\u5f97\u7cfb\u7edf\u7248\u672c\u4fe1\u606f<br \/>\nwmic datafile where Name=&#8217;c:\/\/windows\/\/explorer.exe&#8217; get Manufacturer,Version,Filename<\/p>\n<p>\u83b7\u5f97\u7cfb\u7edf\u8fdb\u7a0b<br \/>\nwmic process list full \u6ce8\u610f\uff1a<br \/>\n\u8fd9\u91cc\u7684full\u4e5f\u53ef\u4ee5\u6362\u6210brief\uff08\u7b80\u6d01\uff09<\/p>\n<p>\u83b7\u5f97\u786c\u4ef6\u4fe1\u606f\uff08\u8fd9\u91cc\u4ee5cpu\u4e3a\u4f8b\uff09<br \/>\nwmic cpu get name,caption,maxclockspeed,description<\/p>\n<p>\u5c06\u7ed3\u679c\u8f93\u51fa\u5230d\u76d8\u76841.txt\u91cc\u9762<br \/>\nwmic \/output:D:\/1.txt cpu get name<\/p>\n<p>wmic \u83b7\u53d6\u786c\u76d8\u56fa\u5b9a\u5206\u533a\u76d8\u7b26:<br \/>\nwmic logicaldisk where &#8220;drivetype=3&#8221; get name<\/p>\n<p>wmic \u83b7\u53d6\u786c\u76d8\u5404\u5206\u533a\u6587\u4ef6\u7cfb\u7edf\u4ee5\u53ca\u53ef\u7528\u7a7a\u95f4\uff1a<br \/>\nwmic logicaldisk where &#8220;drivetype=3&#8243; get name,filesystem,freespace<\/p>\n<p>wmic \u83b7\u53d6\u8fdb\u7a0b\u540d\u79f0\u4ee5\u53ca\u53ef\u6267\u884c\u8def\u5f84:<br \/>\nwmic process get name,executablepath<\/p>\n<p>wmic \u5220\u9664\u6307\u5b9a\u8fdb\u7a0b(\u6839\u636e\u8fdb\u7a0b\u540d\u79f0):<br \/>\nwmic process where name=&#8221;qq.exe&#8221; call terminate<br \/>\n\u6216\u8005\u7528<br \/>\nwmic process where name=&#8221;qq.exe&#8221; delete<\/p>\n<p>wmic \u5220\u9664\u6307\u5b9a\u8fdb\u7a0b(\u6839\u636e\u8fdb\u7a0bPID):<br \/>\nwmic process where pid=&#8221;123&#8243; delete<\/p>\n<p>wmic \u521b\u5efa\u65b0\u8fdb\u7a0b<br \/>\nwmic process call create &#8220;C:\/Program Files\/Tencent\/QQ\/QQ.exe&#8221;<\/p>\n<p>\u5728\u8fdc\u7a0b\u673a\u5668\u4e0a\u521b\u5efa\u65b0\u8fdb\u7a0b\uff1a<br \/>\nwmic \/node:192.168.1.10 \/user:administrator \/password:123456 process call create cmd.exe<\/p>\n<p>\u5173\u95ed\u672c\u5730\u8ba1\u7b97\u673a<br \/>\nwmic process call create shutdown.exe<\/p>\n<p>\u91cd\u542f\u8fdc\u7a0b\u8ba1\u7b97\u673a<br \/>\nwmic \/node:192.168.1.10\/user:administrator \/password:123456 process call create &#8220;shutdown.exe -r -f -m&#8221;<\/p>\n<p>\u66f4\u6539\u8ba1\u7b97\u673a\u540d\u79f0<br \/>\nwmic computersystem where &#8220;caption=&#8217;%ComputerName%'&#8221; call rename newcomputername<\/p>\n<p>\u66f4\u6539\u5e10\u6237\u540d<br \/>\nwmic USERACCOUNT where &#8220;name=&#8217;%UserName%'&#8221; call rename newUserName<\/p>\n<p>wmic \u7ed3\u675f\u53ef\u7591\u8fdb\u7a0b\uff08\u6839\u636e\u8fdb\u7a0b\u7684\u542f\u52a8\u8def\u5f84\uff09<br \/>\nwmic process where &#8220;name=&#8217;explorer.exe&#8217; and executablepath&lt;&gt;&#8217;%SystemDrive%\/\/windows\/\/explorer.exe'&#8221; delete<\/p>\n<p>wmic \u83b7\u53d6\u7269\u7406\u5185\u5b58<br \/>\nwmic memlogical get TotalPhysicalMemory|find \/i \/v &#8220;t&#8221;<\/p>\n<p>wmic \u83b7\u53d6\u6587\u4ef6\u7684\u521b\u5efa\u3001\u8bbf\u95ee\u3001\u4fee\u6539\u65f6\u95f4<br \/>\n@echo off<br \/>\n&#8216;wmic datafile where name^=&#8221;c:\/\/windows\/\/system32\/\/notepad.exe&#8221; get CreationDate^,LastAccessed^,LastModified<\/p>\n<p>wmic \u5168\u76d8\u641c\u7d22\u67d0\u6587\u4ef6\u5e76\u83b7\u53d6\u8be5\u6587\u4ef6\u6240\u5728\u76ee\u5f55<br \/>\nwmic datafile where &#8220;FileName=&#8217;qq&#8217; and extension=&#8217;exe'&#8221; get drive,path<br \/>\nfor \/f &#8220;skip=1 tokens=1*&#8221; %i in (&#8216;wmic datafile where &#8220;FileName=&#8217;qq&#8217; and extension=&#8217;exe'&#8221; get drive^,path&#8217;) do (set &#8220;qPath=%i%j&#8221;&amp;@echo %qPath:~0,-3%)<\/p>\n<p>\u83b7\u53d6\u5c4f\u5e55\u5206\u8fa8\u7387<br \/>\nwmic DESKTOPMONITOR where Status=&#8217;ok&#8217; get ScreenHeight,ScreenWidth<\/p>\n<p>\u83b7\u53d6\u5171\u4eab\u8d44\u6e90(\u5305\u62ec\u9690\u85cf\u5171\u4eab)<br \/>\nWMIC share list brief<\/p>\n<p>\u83b7\u53d6U\u76d8\u76d8\u7b26\uff0c\u5e76\u8fd0\u884cU\u76d8\u4e0a\u7684QQ.exe<br \/>\n@for \/f &#8220;skip=1 tokens=*&#8221; %i in (&#8216;wmic logicaldisk where &#8220;drivetype=2&#8221; get name&#8217;) do (if not &#8220;%i&#8221;==&#8221;&#8221; start d:\/qq.exe)<\/p>\n<p>\u83b7\u5f97\u8fdb\u7a0b\u5f53\u524d\u5360\u7528\u7684\u5185\u5b58\u548c\u6700\u5927\u5360\u7528\u5185\u5b58\u7684\u5927\u5c0f\uff1a<br \/>\nwmic process where caption=&#8217;filename.exe&#8217; get WorkingSetSize,PeakWorkingSetSize<\/p>\n<p>\u66f4\u6539\u73b0\u6709\u5de5\u4f5c\u7ec4\u4e3a\u6307\u5b9a\u7684\u5de5\u4f5c\u7ec4<br \/>\nwmic computersystem Where &#8220;name=&#8217;\u8ba1\u7b97\u673a\u540d\u79f0&#8217; call UnjoinDomainOrWorkgroup<\/p>\n<p>\u9000\u51fa\u6240\u5728\u57df<br \/>\nwmic computersystem Where &#8220;name=&#8217;\u8ba1\u7b97\u673a\u540d\u79f0'&#8221; call joindomainorworkgroup &#8220;&#8221;,1,&#8221;\u57df\u540d\u79f0&#8221;,&#8221;\u57df\u7ba1\u7406\u5458\u5bc6\u7801&#8221;,&#8221;\u57df\u7ba1\u7406\u5458\u7528\u6237\u540d&#8221;<\/p>\n<p>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br \/>\n\u5f002003\u76843389<br \/>\nwmic RDTOGGLE WHERE ServerName=&#8217;%COMPUTERNAME%&#8217; call<br \/>\nSetAllowTSConnections 1<\/p>\n<p>\u8fdc\u7a0b\u6253\u5f00\u8ba1\u7b97\u673a\u8fdc\u7a0b\u684c\u9762<br \/>\nwmic \/node:%pcname% \/USER:%pcaccount% PATH win32_terminalservicesetting WHERE (__Class!=&#8221;&#8221;) CALL SetAllowTSConnections 1<\/p>\n<p>\u6dfb\u52a0\u7684\u8ba1\u5212\u4efb\u52a1\uff0cwmic\u6dfb\u52a0\u7684\u540c\u6837AT\u547d\u4ee4\u4e5f\u662f\u53ef\u4ee5\u770b\u5230<br \/>\nwmic job call create &#8220;sol.exe&#8221;,0,0,true,false,********154800.000000+480<br \/>\nwmic job call create &#8220;sol.exe&#8221;,0,0,1,0,********154600.000000+480<br \/>\n\u8fd9\u4e24\u53e5\u662f\u76f8\u540c\u7684\uff0cTRUE\u53ef\u4ee5\u75281\u8868\u793a\uff0c\u540c\u6837\u7684FALSE\u53ef\u4ee5\u75280\u503c\u8868\u793a\uff0c\u65f6\u95f4\u524d\u4e3a\u4f55\u7528\u516b\u4e2a\u661f\u53f7\uff0c\u8fd9\u662fWMIC\u7684\u7279\u6027\uff0c\u4ed6\u663e\u793a\u65f6\u95f4\u7684\u65b9\u5f0f\u662fYYYYMMDDHHMMSS.MMMMMM+\u65f6\u533a ,\u53ef\u662f\uff0c\u6211\u4eec\u5e76\u4e0d\u9700\u8981\u6307\u5b9a\u5e74\u4efd\u548c\u6708\u4efd\u8fd8\u6709\u5929\uff0c\u6240\u4ee5\u7528*\u661f\u53f7\u6765\u66ff\u4ee3<\/p>\n<p>\u5728wmic\u4e0b\u67e5\u770bBIOS\u4fe1\u606f<br \/>\nwmic bios list full<\/p>\n<p>wmic\u8fd8\u6709\u505c\u6b62\u3001\u6682\u505c\u548c\u8fd0\u884c\u670d\u52a1\u7684\u529f\u80fd\uff1a<br \/>\n\u542f\u52a8\u670d\u52a1startservice\uff0c\u505c\u6b62\u670d\u52a1stopservice\uff0c\u6682\u505c\u670d\u52a1pauseservice\u3002<br \/>\n\u5177\u4f53\u7684\u547d\u4ee4\u4f7f\u7528\u683c\u5f0f\u5c31\u662f\uff1a<br \/>\nwmic Service where caption=\u201dwindows time\u201d call stopservice<br \/>\n\uff0d\uff0d\u505c\u6b62\u670d\u52a1<br \/>\nwmic Service where caption=\u201dwindows time\u201d call startservice<br \/>\n\uff0d\uff0d\u542f\u52a8\u670d\u52a1<br \/>\nwmic Service where name=\u201dw32time\u201d call stopservice<br \/>\n\uff0d\uff0d\u505c\u6b62\u670d\u52a1\uff0c\u6ce8\u610fname\u548ccaption\u7684\u533a\u522b\u3002<\/p>\n<p>\u8fdc\u7a0b\u521b\u5efa\u8fdb\u7a0b<br \/>\nwmic \/node:109.254.2.102 \/user:&#8221;rdgad\/administrator&#8221; \/password:&#8221;1234&#8243; process call create commandline=&#8221;cmd.exe \/k echo xxxxx|clip.exe&#8221;<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"lang:default decode:true \">wmic bios                           ----- \u67e5\u770bbios\u4fe1\u606f\nwmic qfe                            ----- \u67e5\u770b\u8865\u4e01\u4fe1\u606f\nwmic qfe get hotfixid               ----- \u67e5\u770b\u8865\u4e01-Patch\u53f7\nwmic startup                        ----- \u67e5\u770b\u542f\u52a8\u9879\nwmic service                        ----- \u67e5\u770b\u670d\u52a1\nwmic os                             ----- \u67e5\u770bOS\u4fe1\u606f\nwmic process get caption,executablepath,commandline\nwmic process call create \u201cprocess_name\u201d (executes a program)\nwmic process where name=\u201dprocess_name\u201d call terminate (terminates program)\nwmic logicaldisk where drivetype=3 get name, freespace, systemname, filesystem, size,\nvolumeserialnumber (hard drive information)\nwmic useraccount (usernames, sid, and various security related goodies)\nwmic useraccount get \/ALL\nwmic share get \/ALL (you can use ? for gets help ! )\nwmic startup list full (this can be a huge list!!!)\nwmic \/node:\"hostname\" bios get serialnumber (this can be great for finding warranty info about target)<\/pre>\n<p>&nbsp;<\/p>\n<h6>\u53c2\u8003\u94fe\u63a5\uff1a<\/h6>\n<ul>\n<li><a href=\"http:\/\/blog.csdn.net\/tercel99\/article\/details\/6403823\" target=\"_blank\">WMIC\u547d\u4ee4\u6574\u7406 &#8211; Tercel99\u7684\u4e13\u680f<\/a><\/li>\n<li><a href=\"http:\/\/www.jb51.net\/article\/49987.htm\" target=\"_blank\">Windows WMIC\u547d\u4ee4\u4f7f\u7528\u8be6\u89e3(\u9644\u5b9e\u4f8b)<\/a><\/li>\n<li><a href=\"http:\/\/technet.microsoft.com\/zh-cn\/library\/cc782919(v=ws.10).aspx\" target=\"_blank\">\u8fd0\u884c Windows Management Instrumentation \u547d\u4ee4\u884c<\/a><\/li>\n<li><a href=\"http:\/\/www.freebuf.com\/articles\/web\/5901.html\" target=\"_blank\">\u5185\u7f51(\u57df)\u6e17\u900f\u4e4b\u5e38\u89c1\u547d\u4ee4(\u7eed)<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>WMIC\u547d\u4ee4\u5728\u6211\u4eec\u7684\u5de5\u4f5c\u4e2d\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u51cf\u5c11\u5bf9\u5176\u4ed6\u5de5\u5177\u7684\u4f9d\u8d56\u5e76\u8282\u7701\u6211\u4eec\u7684\u65f6\u95f4\uff0c\u503c\u5f97\u5b66\u4e60\u3002 \u547d\u4ee4\u5f88\u591a\uff0c\u4e0b\u9762\u662f\u4ece\u7f51\u4e0a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,20],"tags":[123],"class_list":["post-256","post","type-post","status-publish","format-standard","hentry","category-tools","category-windows","tag-wmi"],"views":8777,"_links":{"self":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/comments?post=256"}],"version-history":[{"count":0,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/posts\/256\/revisions"}],"wp:attachment":[{"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/media?parent=256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/categories?post=256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ixyzero.com\/blog\/wp-json\/wp\/v2\/tags?post=256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}