windows超级命令行wmic

2022-09-30 19:45:33 浏览数 (1)

https://superuser.com/questions/1252565/how-to-get-primary-harddisk-serial-number-only

代码语言:javascript复制
wmic process get ExecutablePath,ProcessId,Description,ParentProcessId,ReadOperationCount,WriteOperationCount,ThreadCount /format:table
wmic process get ExecutablePath,ProcessId,Description,ParentProcessId,ReadOperationCount,WriteOperationCount,ThreadCount /format:list

https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc738752(v=ws.10)

https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-server-2003/cc758713(v=ws.10)

wmic partition where(DeviceID="Disk #0, Partition #0") list brief /format:list

wmic partition where(DeviceID="Disk #0, Partition #0") list full /format:list

wmic diskdrive where index=0 list full /format:list|findstr Partitions

wmic volume where "driveletter='C:'" list full /format:list

wmic OS get LastBootUpTime

//查看系统上次启动的时间

wmic os get LocalDateTime

//获取当前精确时间

wmic process where name='mspaint.exe' call terminate

//根据进程名结束进程

下面这个也是结束进程的命令,但是看到delete有点不太敢执行

wmic process where name='mspaint.exe' delete 顾名思义好像是删除文件,其实是删除进程,进程对应的文件还是存在的,例如

wmic process where name='SubnetAbacus.exe' delete

wmic process where name='httpd.exe' get executablepath,processid,threadcount

//根据进程名确定进程路径、进程号、线程数

wmic process where name='httpd.exe' get executablepath,processid,threadcount | find /i "httpd.exe" /c

//统计同名进程数

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

//确定屏幕分辨率 (云服务器本身没有实体屏幕,无法获取到,普通电脑可以)

wmic logicaldisk where "drivetype=3" get name

//确定磁盘分区情况

wmic logicaldisk where "drivetype=3" get name,filesystem,freespace

//确定磁盘分区情况包括分区名、文件系统、剩余空间

wmic os get captial

wmic os get version

wmic os get caption,version

wmic os get caption,version,buildnumber /format:list

0 人点赞