1。在运行中或命令行提示符中运行wmic,可执行相关命令,具体参数可通过/?查看
2。举例:wmic 获取进程名称以及可执行路径:
wmic process getname,executablepath 不带get参数获取所有进程信息,该命令很常用,可查看进程占用文件情况(wmic process |findstr 占用的文件名),如信息比较多,可导出为文本如wmic process > d:\1.txt再查看详细
wmic 删除指定进程(根据进程名称):
wmic process where name="qq.exe" callterminate
或者用wmic process wherename="qq.exe" delete
wmic 删除指定进程(根据进程PID):
wmic process wherepid="123" delete
wmic 结束可疑进程(根据进程的启动路径):
wmic process where"name='explorer.exe' and executablepath<>'%SystemDrive%//windows//explorer.exe'"delete
在win 7系统
可以通过执行如下命令直接获得硬盘和USB存储设备的序列号:
wmic diskdrive get serialnumber,mediatype,model
在win xp系统中可以get signature,即完整的命令如下:
wmic diskdrive get signature,mediatype,model
远程打开计算机远程桌面
wmic /node:%pcname% /USER:%pcaccount% PATHwin32_terminalservicesetting WHERE (__Class!="") CALL SetAllowTSConnections 1