Windows系统故障排查命令详解

admin 2026-03-05 19:33:28 网络安全文章 来源:ZONE.CI 全球网 0 阅读模式

文章总结: 文档系统讲解了Windows系统故障排查的常用命令与脚本,涵盖系统状态检查、启动问题、性能问题、网络问题、磁盘问题等多个维度。提供了详细的命令示例、速查表和排查流程图,具有较强的实操指导价值,适合运维人员快速定位和解决系统故障。 综合评分: 85 文章分类: 安全运营,终端安全,实战经验


cover_image

Windows 系统故障排查命令详解

原创

刘军军 刘军军

运维星火燎原

2026年3月5日 00:00 河北

目录

  1. 系统状态快速检查
  2. 启动问题排查
  3. 性能问题排查
  4. 网络问题排查
  5. 磁盘问题排查
  6. 服务问题排查
  7. 用户权限问题排查
  8. 系统日志分析
  9. 自动化排查脚本
  10. 故障排查流程图

一、系统状态快速检查

1.1 一键系统健康检查

:: ========== 快速检查脚本 ==========
@echo off
echo ====================================
echo   Windows 系统健康检查
echo ====================================
echo.

:: 1. 系统基本信息
echo [1] 系统信息
systeminfo | findstr /C:"OS 名称" /C:"OS 版本" /C:"系统型号"
echo.

:: 2. 运行时间
echo [2] 运行时间
systeminfo | findstr /C:"系统启动时间"
echo.

:: 3. 磁盘空间
echo [3] 磁盘空间
wmic logicaldisk get DeviceID,Size,FreeSpace,FileSystem
echo.

:: 4. 内存使用
echo [4] 内存使用
wmic OS get FreePhysicalMemory,TotalVisibleMemorySize /Value
echo.

:: 5. 关键服务状态
echo [5] 关键服务状态
sc query RpcSs | findstr "STATE"
sc query BITS | findstr "STATE"
sc query wuauserv | findstr "STATE"
echo.

:: 6. 网络连接
echo [6] 网络连接
netstat -ano | findstr "ESTABLISHED" | find /c /v ""
echo.

:: 7. 系统文件检查
echo [7] 系统文件完整性
sfc /verifyonly
echo.

echo ====================================
echo   检查完成
echo ====================================
pause

1.2 系统信息收集命令

:: ========== 完整系统信息 ==========
:: 操作系统信息
systeminfo
ver
wmic os get Caption,Version,Architecture,InstallDate

:: 硬件信息
wmic cpu get Name,NumberOfCores,NumberOfLogicalProcessors,MaxClockSpeed
wmic memorychip get Capacity,Speed,Manufacturer
wmic diskdrive get Model,Size,InterfaceType
wmic bios get SerialNumber,Manufacturer,Version

:: 已安装软件
wmic product get Name,Version,InstallDate
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall

:: 启动项
wmic startup get Caption,Command
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
reg query HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

:: 驱动程序
driverquery /v
pnputil /enum-drivers

:: 导出完整报告
systeminfo > C:\report\systeminfo.txt
wmic /output:C:\report\hardware.txt cpu get Name,NumberOfCores
wmic /output:C:\report\memory.txt memorychip get Capacity,Speed
wmic /output:C:\report\disk.txt diskdrive get Model,Size

1.3 系统状态速查表

| | | | | — | — | — | | 检查项 | 命令 | 正常状态 | | 系统版本 | ver | 显示正确版本号 | | 运行时间 | systeminfo | find “启动时间” | 合理范围内 | | CPU 使用 | wmic cpu get loadpercentage | <80% | | 内存使用 | wmic OS get FreePhysicalMemory | 有足够可用内存 | | 磁盘空间 | wmic logicaldisk get Size,FreeSpace | 剩余>10% | | 关键服务 | sc query 服务名 | RUNNING | | 网络连接 | netstat -ano | 正常连接数 | | 系统文件 | sfc /verifyonly | 无损坏 |

二、启动问题排查

2.1 启动故障诊断

:: ========== 启动配置检查 ==========
:: 查看启动配置
bcdedit /enum

:: 查看启动日志
eventvwr.msc
:: 或使用命令行
wevtutil qe System /c:50&nbsp;/f:text /q:"*[System]"

:: 检查启动项
msconfig
wmic startup&nbsp;get&nbsp;Caption,Command
reg&nbsp;query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
reg&nbsp;query HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run

:: 检查服务启动类型
sc queryex&nbsp;type= service
sc qc 服务名

:: 查看上次启动错误
eventvwr.msc
:: 筛选事件 ID:&nbsp;41,&nbsp;6008&nbsp;(意外关机)

2.2 启动修复命令

:: ========== 启动修复 ==========
:: 系统文件修复
sfc /scannow
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth

:: 启动修复
bootrec /fixmbr
bootrec /fixboot
bootrec /scanos
bootrec /rebuildbcd

:: 检查磁盘
chkdsk C: /f /r

:: 修复系统组件
DISM /Online /Cleanup-Image /StartComponentCleanup

:: 重置 Windows 更新组件
net&nbsp;stop&nbsp;wuauserv
net&nbsp;stop&nbsp;cryptSvc
net&nbsp;stop&nbsp;bits
net&nbsp;stop&nbsp;msiserver
ren C:\Windows\SoftwareDistribution SoftwareDistribution.old
ren C:\Windows\System32\catroot2 catroot2.old
net&nbsp;start&nbsp;wuauserv
net&nbsp;start&nbsp;cryptSvc
net&nbsp;start&nbsp;bits
net&nbsp;start&nbsp;msiserver

2.3 启动问题排查流程

┌─────────────────────────────────────────────────────────────────┐
│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;系统无法启动 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
└─────────────────────────┬───────────────────────────────────────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼
┌─────────────────────────────────────────────────────────────────┐
│ &nbsp;1.&nbsp;进入安全模式 (F8/Shift+ 重启) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp; - 确认是否能进入安全模式 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
└─────────────────────────┬───────────────────────────────────────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ┌───────────────┼───────────────┐
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼
&nbsp; &nbsp; ┌──────────┐ &nbsp; ┌──────────┐ &nbsp; ┌──────────┐
&nbsp; &nbsp; │ 能进入 &nbsp; &nbsp;│ &nbsp; │ 不能进入 &nbsp;│ &nbsp; │ 蓝屏 &nbsp; &nbsp; │
&nbsp; &nbsp; └────┬─────┘ &nbsp; └────┬─────┘ &nbsp; └────┬─────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;▼
&nbsp; &nbsp; 检查启动项 &nbsp; &nbsp; &nbsp;使用修复盘 &nbsp; &nbsp; &nbsp;记录错误代码
&nbsp; &nbsp; 检查服务 &nbsp; &nbsp; &nbsp; &nbsp;启动修复 &nbsp; &nbsp; &nbsp; &nbsp;分析 dump 文件
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└──────────────┼──────────────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼
┌─────────────────────────────────────────────────────────────────┐
│ &nbsp;2.&nbsp;执行系统修复 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp; sfc /scannow &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp; DISM /Online /Cleanup-Image /RestoreHealth &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
│ &nbsp; &nbsp; chkdsk C:&nbsp;/f /r &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
└─────────────────────────────────────────────────────────────────┘

三、性能问题排查

3.1 CPU 占用高排查

:: ========== CPU 使用率检查 ==========
:: 查看 CPU 使用率
wmic cpu&nbsp;get&nbsp;loadpercentage
wmic cpu&nbsp;get&nbsp;Name,NumberOfCores,NumberOfLogicalProcessors,LoadPercentage

:: 查看进程 CPU 使用
tasklist /v | findstr /i&nbsp;"cpu"
tasklist /fo&nbsp;csv | findstr /i&nbsp;"cpu"

:: 查看占用 CPU 最高的进程
powershell&nbsp;"Get-Process | Sort-Object CPU -Descending | Select-Object -First 10 Name,CPU"

:: 实时监控
typeperf&nbsp;"\Processor(_Total)\% Processor Time"&nbsp;-si&nbsp;5&nbsp;-sc&nbsp;12

:: 终止高占用进程
tasklist | findstr&nbsp;"进程名"
taskkill /PID 进程号 /F
taskkill /IM 进程名.exe&nbsp;/F

:: 检查启动项(可能占用 CPU)
wmic startup&nbsp;get&nbsp;Caption,Command
msconfig

3.2 内存占用高排查

:: ========== 内存使用检查 ==========
:: 查看内存总量和可用量
wmic OS&nbsp;get&nbsp;FreePhysicalMemory,TotalVisibleMemorySize /Value
systeminfo | findstr /C:"物理内存"

:: 查看进程内存使用
tasklist /v
tasklist /fo&nbsp;csv

:: 查看内存使用前&nbsp;10&nbsp;进程
powershell&nbsp;"Get-Process | Sort-Object WorkingSet -Descending | Select-Object -First 10 Name,@{N='Memory(MB)';E={[math]::Round($_.WorkingSet/1MB,2)}}"

:: 查看分页池和非分页池
poolmon.exe&nbsp; (需要 Windows SDK)

:: 检查内存泄漏
driverquery /v | findstr /i&nbsp;"memory"

:: 清理内存(临时)
emptystandby.exe&nbsp; (第三方工具)
:: 或重启相关服务

3.3 磁盘 IO 高排查

:: ========== 磁盘 IO 检查 ==========
:: 查看磁盘使用率
wmic logicaldisk&nbsp;get&nbsp;DeviceID,Size,FreeSpace

:: 查看磁盘性能
typeperf&nbsp;"\PhysicalDisk(_Total)\% Disk Time"&nbsp;-si&nbsp;5&nbsp;-sc&nbsp;12
typeperf&nbsp;"\PhysicalDisk(_Total)\Avg. Disk Queue Length"&nbsp;-si&nbsp;5&nbsp;-sc&nbsp;12

:: 查看磁盘活动进程
resource monitor &nbsp;(resmon)

:: 检查磁盘错误
chkdsk C: /f
wmic diskdrive&nbsp;get&nbsp;Status

:: 查看大文件
powershell&nbsp;"Get-ChildItem C:\ -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.Length -gt 100MB} | Sort-Object Length -Descending | Select-Object -First 20 FullName,@{N='Size(MB)';E={[math]::Round($_.Length/1MB,2)}}"

:: 磁盘碎片检查
defrag C: /A

:: 清理磁盘空间
cleanmgr

3.4 系统性能监控命令

:: ========== 性能监视器 ==========
:: 启动性能监视器
perfmon

:: 启动资源监视器
resmon

:: 创建性能计数器日志
logman&nbsp;create&nbsp;counter&nbsp;"SystemMonitor"&nbsp;-o&nbsp;"C:\perf\counter.blg"&nbsp;-c&nbsp;"\Processor(_Total)\% Processor Time""\Memory\Available MBytes""\PhysicalDisk(_Total)\% Disk Time"&nbsp;-si&nbsp;00:01:00

:: 启动日志
logman&nbsp;start"SystemMonitor"

:: 停止日志
logman&nbsp;stop"SystemMonitor"

:: 查看日志
logman&nbsp;query"SystemMonitor"

:: 导出性能报告
perfmon /report

四、网络问题排查

4.1 网络连通性排查

:: ========== 网络连通性检查 ==========
::&nbsp;1. 检查本地网络配置
ipconfig /all
getmac /v

::&nbsp;2. 测试网关连通性
ping&nbsp;192.168.1.1&nbsp;-n&nbsp;4
ping&nbsp;192.168.1.1&nbsp;-t &nbsp;(持续测试)

::&nbsp;3. 测试外网连通性
ping&nbsp;8.8.8.8&nbsp;-n&nbsp;4
ping www.baidu.com&nbsp;-n&nbsp;4

::&nbsp;4. 路由跟踪
tracert www.baidu.com
pathping www.baidu.com

::&nbsp;5. DNS 测试
nslookup www.baidu.com
nslookup -type=mx baidu.com

::&nbsp;6. 端口测试
telnet&nbsp;192.168.1.10080
Test-NetConnection&nbsp;192.168.1.100&nbsp;-Port&nbsp;80&nbsp; (PowerShell)

::&nbsp;7. 网络连接统计
netstat -ano
netstat -ano | findstr&nbsp;"ESTABLISHED"
netstat -ano | findstr&nbsp;":80"

4.2 网络故障修复命令

:: ========== 网络修复 ==========
:: 释放和更新 IP
ipconfig /release
ipconfig /renew

:: 清理 DNS 缓存
ipconfig /flushdns
ipconfig /registerdns

:: 重置 Winsock
netsh winsock&nbsp;reset

:: 重置 TCP/IP
netsh&nbsp;int&nbsp;ip&nbsp;reset
netsh&nbsp;int&nbsp;ipv4&nbsp;reset
netsh&nbsp;int&nbsp;ipv6&nbsp;reset

:: 重置网络
netsh advfirewall&nbsp;reset

:: 重启网络服务
net&nbsp;stop&nbsp;lanmanworkstation
net&nbsp;start&nbsp;lanmanworkstation

:: 禁用/启用网卡
netsh&nbsp;interfacesetinterface"以太网"disable
netsh&nbsp;interfacesetinterface"以太网"enable

:: 查看网络配置
netsh&nbsp;interface&nbsp;ip&nbsp;show&nbsp;config
netsh wlan&nbsp;show&nbsp;profiles

4.3 网络问题排查流程

:: ========== 网络诊断脚本 ==========
@echo&nbsp;off
echo&nbsp;====================================
echo&nbsp; &nbsp;网络故障排查
echo&nbsp;====================================
echo.

:: 1. 检查网卡状态
echo&nbsp;[1] 网卡状态
ipconfig | findstr /C:"IPv4"&nbsp;/C:"媒体状态"
echo.

:: 2. 测试网关
echo&nbsp;[2] 网关测试
for&nbsp;/f&nbsp;"tokens=2"&nbsp;%%i&nbsp;in&nbsp;('ipconfig ^| findstr /C:"默认网关"')&nbsp;do&nbsp;(
&nbsp; &nbsp;&nbsp;set&nbsp;gateway=%%i
&nbsp; &nbsp; ping %%i -n 2
)
echo.

:: 3. 测试 DNS
echo&nbsp;[3] DNS 测试
nslookup www.baidu.com
echo.

:: 4. 测试外网
echo&nbsp;[4] 外网测试
ping 8.8.8.8 -n 2
echo.

:: 5. 检查端口
echo&nbsp;[5] 监听端口
netstat -ano | findstr&nbsp;"LISTENING"
echo.

:: 6. 检查防火墙
echo&nbsp;[6] 防火墙状态
netsh advfirewall show allprofiles state
echo.

echo&nbsp;====================================
pause

五、磁盘问题排查

5.1 磁盘健康检查

:: ========== 磁盘健康检查 ==========
:: 检查磁盘状态
wmic diskdrive&nbsp;get&nbsp;Status
wmic diskdrive&nbsp;get&nbsp;Model,Status,Size

:: 检查磁盘错误
chkdsk C: /f
chkdsk C: /f&nbsp;/r
chkdsk C: /x

:: 检查磁盘 SMART 状态
wmic diskdrive&nbsp;get&nbsp;Status,Model,SerialNumber

:: 查看磁盘空间
wmic logicaldisk&nbsp;get&nbsp;DeviceID,Size,FreeSpace,FileSystem
fsutil volume diskfree C:

:: 查看磁盘分区
diskpart
list&nbsp;disk
list&nbsp;partition
exit

:: 检查磁盘性能
typeperf&nbsp;"\PhysicalDisk(_Total)\% Disk Time"&nbsp;-si&nbsp;5&nbsp;-sc&nbsp;12
typeperf&nbsp;"\PhysicalDisk(_Total)\Avg. Disk Queue Length"&nbsp;-si&nbsp;5&nbsp;-sc&nbsp;12

5.2 磁盘空间清理

:: ========== 磁盘清理 ==========
:: 清理临时文件
del /f&nbsp;/s /q %temp%\*
del /f&nbsp;/s /q C:\Windows\Temp\*

:: 清理 Windows 更新缓存
net&nbsp;stop&nbsp;wuauserv
del /f&nbsp;/s /q C:\Windows\SoftwareDistribution\Download\*
net start wuauserv

:: 清理系统文件
cleanmgr /sageset:1
cleanmgr /sagerun:1

:: 清理旧版本 Windows
Dism.exe&nbsp;/online /Cleanup-Image /StartComponentCleanup
Dism.exe&nbsp;/online /Cleanup-Image /SPSuperseded

:: 清理休眠文件
powercfg /h off

:: 清理页面文件(需要重启)
wmic pagefileset&nbsp;delete
wmic pagefileset create name="C:\pagefile.sys"

:: 查找大文件
powershell&nbsp;"Get-ChildItem C:\ -Recurse -ErrorAction SilentlyContinue | Where-Object {$_.Length -gt 500MB} | Sort-Object Length -Descending | Select-Object -First 10 FullName,@{N='Size(GB)';E={[math]::Round($_.Length/1GB,2)}}"

5.3 磁盘故障排查流程

┌─────────────────────────────────────────────────────────────────┐
│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;磁盘问题报告 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
└─────────────────────────┬───────────────────────────────────────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ┌───────────────┼───────────────┐
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼
&nbsp; &nbsp; ┌──────────┐ &nbsp; ┌──────────┐ &nbsp; ┌──────────┐
&nbsp; &nbsp; │ 空间不足 &nbsp;│ &nbsp; │ 读写错误 &nbsp;│ &nbsp; │ 性能下降 &nbsp;│
&nbsp; &nbsp; └────┬─────┘ &nbsp; └────┬─────┘ &nbsp; └────┬─────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;▼
&nbsp; &nbsp; wmic 检查空间 &nbsp; chkdsk 检查 &nbsp; &nbsp;typeperf 监控
&nbsp; &nbsp; 清理临时文件 &nbsp; &nbsp;修复错误 &nbsp; &nbsp; &nbsp;查找瓶颈进程
&nbsp; &nbsp; 删除大文件 &nbsp; &nbsp; &nbsp;备份数据 &nbsp; &nbsp; &nbsp;优化配置
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└──────────────┼──────────────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼
┌─────────────────────────────────────────────────────────────────┐
│ &nbsp;验证修复 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
│ &nbsp;- 重新检查磁盘状态 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
│ &nbsp;- 监控系统性能 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
│ &nbsp;- 建立定期维护计划 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
└─────────────────────────────────────────────────────────────────┘

六、服务问题排查

6.1 服务状态检查

:: ========== 服务状态检查 ==========
:: 查看所有服务
sc query
sc query state=&nbsp;all

:: 查看运行中的服务
sc query&nbsp;type= service state= running

:: 查看停止的服务
sc query&nbsp;type= service state= stopped

:: 查看特定服务
sc query wuauserv
sc queryex wuauserv

:: 查看服务配置
sc qc wuauserv
sc qdescription wuauserv

:: 查看服务依赖
sc enumdepend wuauserv

:: 查看失败服务
sc queryex&nbsp;type= service | findstr&nbsp;"STOPPED"

6.2 服务故障修复

:: ========== 服务修复 ==========
:: 启动服务
net&nbsp;start&nbsp;服务名
sc&nbsp;start&nbsp;服务名

:: 停止服务
net&nbsp;stop&nbsp;服务名
sc&nbsp;stop&nbsp;服务名

:: 重启服务
net&nbsp;stop&nbsp;服务名 && net&nbsp;start&nbsp;服务名

:: 修改启动类型
sc config 服务名&nbsp;start=&nbsp;auto&nbsp; &nbsp; &nbsp; :: 自动
sc config 服务名&nbsp;start=&nbsp;demand&nbsp; &nbsp; :: 手动
sc config 服务名&nbsp;start= disabled &nbsp;:: 禁用

:: 修改服务账户
sc config 服务名 obj=&nbsp;"NT Authority\LocalService"

:: 恢复服务默认配置
sc&nbsp;failure&nbsp;服务名&nbsp;reset=&nbsp;86400&nbsp;actions= restart/60000/restart/60000/restart/60000

:: 重建服务
sc&nbsp;delete&nbsp;服务名
sc&nbsp;create&nbsp;服务名 binPath=&nbsp;"C:\path\to\service.exe"

:: 检查服务日志
eventvwr.msc
:: 筛选:应用程序和服务日志 -> 系统

6.3 关键服务检查列表

:: ========== 关键服务状态检查 ==========
@echo&nbsp;off
echo&nbsp;====================================
echo&nbsp; &nbsp;关键服务状态检查
echo&nbsp;====================================
echo.

set&nbsp;services=RpcSs BITS wuauserv EventLog PlugPlay Winmgmt lanmanworkstation

for&nbsp;%%s&nbsp;in&nbsp;(%services%)&nbsp;do&nbsp;(
&nbsp; &nbsp;&nbsp;echo&nbsp;服务:%%s
&nbsp; &nbsp; sc query %%s | findstr&nbsp;"STATE"
&nbsp; &nbsp;&nbsp;echo.
)

echo&nbsp;====================================
pause

| | | | | — | — | — | | 服务名 | 说明 | 必须状态 | | RpcSs | RPC 服务 | RUNNING | | EventLog | 事件日志 | RUNNING | | PlugPlay | 即插即用 | RUNNING | | Winmgmt | WMI 服务 | RUNNING | | BITS | 后台传输 | RUNNING | | wuauserv | Windows 更新 | 可选 | | lanmanworkstation | 工作站服务 | RUNNING | | Dhcp | DHCP 客户端 | RUNNING | | Dnscache | DNS 客户端 | RUNNING |

七、用户权限问题排查

7.1 用户权限检查

:: ========== 用户权限检查 ==========
:: 查看当前用户
whoami
whoami /all
whoami /priv
whoami /groups

:: 查看用户详细信息
net user 用户名
net user 用户名 /domain &nbsp;(域环境)

:: 查看用户所属组
net user 用户名 | findstr&nbsp;"本地组成员"
whoami /groups

:: 查看管理员组成员
net localgroup administrators

:: 查看用户权限
whoami /priv

:: 检查 UAC 状态
reg&nbsp;query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA

:: 以管理员身份运行
runas /user:administrator cmd

7.2 文件权限检查

:: ========== 文件权限检查 ==========
:: 查看文件权限
icacls C:\path\to\file
icacls C:\path\to\folder /t

:: 查看文件所有者
dir /q C:\path\to\file
takeown /f C:\path\to\file

:: 修复文件权限
icacls C:\path\to\folder /reset&nbsp;/t /c /l

:: 授予权限
icacls C:\path\to\file&nbsp;/grant&nbsp;用户名:F
icacls C:\path\to\file&nbsp;/grant&nbsp;用户名:R

:: 删除权限
icacls C:\path\to\file&nbsp;/remove 用户名

:: 获取所有权
takeown /f C:\path\to\file
takeown /f C:\path\to\folder /r /d y

:: 检查共享权限
net&nbsp;share
net&nbsp;share&nbsp;共享名

7.3 权限问题排查流程

:: ========== 权限排查脚本 ==========
@echo&nbsp;off
echo&nbsp;====================================
echo&nbsp; &nbsp;权限问题排查
echo&nbsp;====================================
echo.

:: 1. 检查当前用户
echo&nbsp;[1] 当前用户
whoami
whoami /groups | findstr&nbsp;"S-1-5-32-544"&nbsp; (检查是否管理员)
echo.

:: 2. 检查 UAC
echo&nbsp;[2] UAC 状态
reg query HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v EnableLUA
echo.

:: 3. 检查文件权限
echo&nbsp;[3] 文件权限
set&nbsp;target=C:\test
if&nbsp;exist %target% (
&nbsp; &nbsp; icacls %target%
)&nbsp;else&nbsp;(
&nbsp; &nbsp;&nbsp;echo&nbsp;目标路径不存在
)
echo.

:: 4. 检查服务权限
echo&nbsp;[4] 服务权限
sc sdshow 服务名
echo.

echo&nbsp;====================================
pause

八、系统日志分析

8.1 事件日志查看

:: ========== 事件日志查看 ==========
:: 打开事件查看器
eventvwr.msc

:: 命令行查看日志
wevtutil qe System /c:50&nbsp;/f:text
wevtutil qe Application /c:50&nbsp;/f:text

:: 查看特定事件 ID
wevtutil qe System /q:"*[System]"&nbsp;/c:10&nbsp;/f:text
wevtutil qe System /q:"*[System]"&nbsp;/c:10&nbsp;/f:text

:: 查看错误日志
wevtutil qe System /q:"*[System[Level=2]]"&nbsp;/c:50&nbsp;/f:text
wevtutil qe Application /q:"*[System[Level=2]]"&nbsp;/c:50&nbsp;/f:text

:: 查看最近关机事件
wevtutil qe System /q:"*[System]"&nbsp;/c:10&nbsp;/f:text

:: 导出日志
wevtutil epl System C:\logs\System.evtx
wevtutil epl Application C:\logs\Application.evtx

:: 清除日志
wevtutil&nbsp;cl&nbsp;System
wevtutil&nbsp;cl&nbsp;Application

8.2 关键事件 ID 说明

| | | | | — | — | — | | 事件 ID | 来源 | 说明 | | 41 | Kernel-Power | 系统意外关机 | | 6005 | EventLog | 事件日志服务启动(开机) | | 6006 | EventLog | 事件日志服务停止(关机) | | 6008 | EventLog | 上次关机是意外的 | | 1074 | User32 | 应用程序发起的关机 | | 4104 | PowerShell | PowerShell 脚本执行 | | 7036 | Service Control Manager | 服务状态更改 | | 1001 | BugCheck | 蓝屏错误 | | 6009 | EventLog | 操作系统版本信息 |

8.3 日志分析脚本

:: ========== 日志分析脚本 ==========
@echo&nbsp;off
echo&nbsp;====================================
echo&nbsp; &nbsp;系统日志分析
echo&nbsp;====================================
echo.

:: 1. 最近错误事件
echo&nbsp;[1] 最近错误事件 (System)
wevtutil qe System /q:"*[System[Level=2]]"&nbsp;/c:10 /f:text | findstr /C:"TimeCreated"&nbsp;/C:"Message"
echo.

:: 2. 意外关机事件
echo&nbsp;[2] 意外关机事件
wevtutil qe System /q:"*[System]"&nbsp;/c:5 /f:text | findstr /C:"TimeCreated"
echo.

:: 3. 服务失败事件
echo&nbsp;[3] 服务失败事件
wevtutil qe System /q:"*[System]"&nbsp;/c:10 /f:text | findstr /C:"TimeCreated"&nbsp;/C:"Message"
echo.

:: 4. 应用程序错误
echo&nbsp;[4] 应用程序错误
wevtutil qe Application /q:"*[System[Level=2]]"&nbsp;/c:10 /f:text | findstr /C:"TimeCreated"&nbsp;/C:"Message"
echo.

echo&nbsp;====================================
pause

九、自动化排查脚本

9.1 综合故障排查脚本

:: ========== 系统故障排查脚本 ==========
:: 文件名:system_diagnosis.bat
:: 需要管理员权限运行

@echo off
title 系统故障排查工具
color&nbsp;0a

set&nbsp;LOG_DIR=C:\Diagnosis
set&nbsp;LOG_FILE=%LOG_DIR%\diagnosis_%date:~0,4%%date:~5,2%%date:~8,2%_%time:~0,2%%time:~3,2%.log
set&nbsp;LOG_FILE=%LOG_FILE: =0%

if&nbsp;not exist %LOG_DIR%&nbsp;mkdir&nbsp;%LOG_DIR%

echo&nbsp;==================================== > %LOG_FILE%
echo&nbsp; &nbsp;系统故障排查报告 >> %LOG_FILE%
echo&nbsp; &nbsp;时间:%date% %time% >> %LOG_FILE%
echo&nbsp;==================================== >> %LOG_FILE%
echo.

:: 记录到屏幕和文件
setlocal&nbsp;EnableDelayedExpansion
for&nbsp;/f"delims="&nbsp;%%a&nbsp;in ('echo ^| findstr /n "^"')&nbsp;doset"LF=%%a"
set"LF=!LF:~0,1!"

::&nbsp;1. 系统信息
echo&nbsp;[1] 系统信息
echo&nbsp;[1] 系统信息 >> %LOG_FILE%
systeminfo | findstr /C:"OS 名称"&nbsp;/C:"OS 版本"&nbsp;/C:"系统启动时间"&nbsp;/C:"系统型号"&nbsp;| tee -a&nbsp;%LOG_FILE%
echo. >> %LOG_FILE%

::&nbsp;2. CPU 和内存
echo&nbsp;[2] CPU 和内存
echo&nbsp;[2] CPU 和内存 >> %LOG_FILE%
wmic cpu&nbsp;get&nbsp;Name,NumberOfCores,LoadPercentage | tee -a&nbsp;%LOG_FILE%
wmic OS&nbsp;get&nbsp;FreePhysicalMemory,TotalVisibleMemorySize /Value | tee -a&nbsp;%LOG_FILE%
echo. >> %LOG_FILE%

::&nbsp;3. 磁盘空间
echo&nbsp;[3] 磁盘空间
echo&nbsp;[3] 磁盘空间 >> %LOG_FILE%
wmic logicaldisk&nbsp;get&nbsp;DeviceID,Size,FreeSpace,FileSystem | tee -a&nbsp;%LOG_FILE%
echo. >> %LOG_FILE%

::&nbsp;4. 关键服务
echo&nbsp;[4] 关键服务
echo&nbsp;[4] 关键服务 >> %LOG_FILE%
for&nbsp;%%s in (RpcSs EventLog BITS wuauserv)&nbsp;do&nbsp;(
&nbsp; &nbsp; sc query %%s | findstr&nbsp;"STATE"&nbsp;| tee -a&nbsp;%LOG_FILE%
)
echo. >> %LOG_FILE%

::&nbsp;5. 网络连接
echo&nbsp;[5] 网络连接
echo&nbsp;[5] 网络连接 >> %LOG_FILE%
ipconfig | findstr /C:"IPv4"&nbsp;/C:"默认网关"&nbsp;| tee -a&nbsp;%LOG_FILE%
echo. >> %LOG_FILE%

::&nbsp;6. 最近错误日志
echo&nbsp;[6] 最近错误日志
echo&nbsp;[6] 最近错误日志 >> %LOG_FILE%
wevtutil qe System /q:"*[System[Level=2]]"&nbsp;/c:5&nbsp;/f:text | findstr /C:"TimeCreated"&nbsp;/C:"Message"&nbsp;| tee -a&nbsp;%LOG_FILE%
echo. >> %LOG_FILE%

::&nbsp;7. 进程列表
echo&nbsp;[7] 高资源进程
echo&nbsp;[7] 高资源进程 >> %LOG_FILE%
tasklist /v | findstr /i&nbsp;"cpu memory"&nbsp;| tee -a&nbsp;%LOG_FILE%
echo. >> %LOG_FILE%

::&nbsp;8. 启动项
echo&nbsp;[8] 启动项
echo&nbsp;[8] 启动项 >> %LOG_FILE%
wmic startup&nbsp;get&nbsp;Caption,Command | tee -a&nbsp;%LOG_FILE%
echo. >> %LOG_FILE%

echo&nbsp;==================================== >> %LOG_FILE%
echo&nbsp; &nbsp;排查完成 >> %LOG_FILE%
echo&nbsp; &nbsp;日志文件:%LOG_FILE% >> %LOG_FILE%
echo&nbsp;==================================== >> %LOG_FILE%

echo.
echo&nbsp;====================================
echo&nbsp; &nbsp;排查完成
echo&nbsp; &nbsp;日志文件:%LOG_FILE%
echo&nbsp;====================================
pause

9.2 网络诊断脚本

:: ========== 网络诊断脚本 ==========
:: 文件名:network_diagnosis.bat

@echo off
title 网络诊断工具
color&nbsp;0b

echo&nbsp;====================================
echo&nbsp; &nbsp;网络诊断工具
echo&nbsp;====================================
echo.

::&nbsp;1. IP 配置
echo&nbsp;[1] IP 配置
ipconfig /all
echo.

::&nbsp;2. 网关测试
echo&nbsp;[2] 网关测试
for&nbsp;/f"tokens=2"&nbsp;%%i in ('ipconfig ^| findstr /C:"默认网关"')&nbsp;do&nbsp;(
&nbsp; &nbsp;&nbsp;set&nbsp;gateway=%%i
&nbsp; &nbsp; ping %%i -n&nbsp;2
&nbsp; &nbsp;&nbsp;goto&nbsp;:next
)
:next
echo.

::&nbsp;3. DNS 测试
echo&nbsp;[3] DNS 测试
nslookup www.baidu.com
echo.

::&nbsp;4. 外网测试
echo&nbsp;[4] 外网测试
ping&nbsp;8.8.8.8&nbsp;-n&nbsp;2
echo.

::&nbsp;5. 端口监听
echo&nbsp;[5] 监听端口
netstat -ano | findstr&nbsp;"LISTENING"
echo.

::&nbsp;6. 连接统计
echo&nbsp;[6] 连接统计
echo&nbsp;总连接数:
netstat -ano |&nbsp;find&nbsp;/c&nbsp;/v&nbsp;""
echo&nbsp;ESTABLISHED 连接:
netstat -ano | findstr&nbsp;"ESTABLISHED"&nbsp;|&nbsp;find&nbsp;/c&nbsp;/v&nbsp;""
echo.

::&nbsp;7. 防火墙状态
echo&nbsp;[7] 防火墙状态
netsh advfirewall show allprofiles state
echo.

::&nbsp;8. 网络修复建议
echo&nbsp;[8] 网络修复命令
echo&nbsp;ipconfig /release
echo&nbsp;ipconfig /renew
echo&nbsp;ipconfig /flushdns
echo&nbsp;netsh winsock reset
echo&nbsp;netsh&nbsp;int&nbsp;ip reset
echo.

echo&nbsp;====================================
pause

9.3 性能监控脚本

:: ========== 性能监控脚本 ==========
:: 文件名:performance_monitor.bat

@echo off
title 性能监控工具
color&nbsp;0c

:loop
cls
echo&nbsp;====================================
echo&nbsp; &nbsp;性能实时监控
echo&nbsp; &nbsp;按 Ctrl+C 退出
echo&nbsp;====================================
echo.

:: 时间
echo&nbsp;时间:%date% %time%
echo.

:: CPU 使用率
echo&nbsp;[CPU 使用率]
wmic cpu&nbsp;get&nbsp;loadpercentage | findstr&nbsp;"[0-9]"
echo.

:: 内存使用
echo&nbsp;[内存使用]
for&nbsp;/f"tokens=2"&nbsp;%%a&nbsp;in ('wmic OS get FreePhysicalMemory /Value ^| find "FreePhysicalMemory"')&nbsp;doset&nbsp;freemem=%%a
for&nbsp;/f"tokens=2"&nbsp;%%a&nbsp;in ('wmic OS get TotalVisibleMemorySize /Value ^| find "TotalVisibleMemorySize"')&nbsp;doset&nbsp;totalmem=%%a
set&nbsp;/a&nbsp;usedmem=%totalmem%-%freemem%
set&nbsp;/a&nbsp;percent=%usedmem%*100/%totalmem%
echo&nbsp;总内存:%totalmem% KB
echo&nbsp;已用内存:%usedmem% KB (%percent%%)
echo.

:: 磁盘空间
echo&nbsp;[磁盘空间 C:]
wmic logicaldisk where&nbsp;"DeviceID='C:'"get&nbsp;Size,FreeSpace | findstr&nbsp;"[0-9]"
echo.

:: 进程数
echo&nbsp;[进程数]
tasklist |&nbsp;find&nbsp;/c&nbsp;/v&nbsp;""
echo.

:: 网络连接数
echo&nbsp;[网络连接数]
netstat -ano |&nbsp;find&nbsp;/c&nbsp;/v&nbsp;""
echo.

timeout /t&nbsp;5&nbsp;/nobreak >nul
goto&nbsp;:loop

十、故障排查流程图

10.1 综合故障排查流程

┌─────────────────────────────────────────────────────────────────┐
│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;系统故障报告 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
└─────────────────────────┬───────────────────────────────────────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼
┌─────────────────────────────────────────────────────────────────┐
│ &nbsp;1. 信息收集 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;系统信息 (systeminfo) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;事件日志 (eventvwr) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;用户反馈 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
└─────────────────────────┬───────────────────────────────────────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ┌───────────────┼───────────────┐
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼
&nbsp; &nbsp; ┌──────────┐ &nbsp; ┌──────────┐ &nbsp; ┌──────────┐
&nbsp; &nbsp; │ 启动问题 &nbsp;│ &nbsp; │ 性能问题 &nbsp;│ &nbsp; │ 网络问题 &nbsp;│
&nbsp; &nbsp; └────┬─────┘ &nbsp; └────┬─────┘ &nbsp; └────┬─────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;▼ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;▼
&nbsp; &nbsp;&nbsp;bcdedit&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;tasklist&nbsp; &nbsp; &nbsp; &nbsp;ipconfig
&nbsp; &nbsp;&nbsp;sfc&nbsp;/scannow&nbsp; &nbsp;perfmon&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;ping/tracert
&nbsp; &nbsp;&nbsp;chkdsk&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;resmon&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;netstat
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;│
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;└──────────────┼──────────────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼
┌─────────────────────────────────────────────────────────────────┐
│ &nbsp;2. 问题分析 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;定位根本原因 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;确定影响范围 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;制定解决方案 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
└─────────────────────────┬───────────────────────────────────────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼
┌─────────────────────────────────────────────────────────────────┐
│ &nbsp;3. 实施修复 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;执行修复命令 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;验证修复效果 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;记录修复过程 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
└─────────────────────────┬───────────────────────────────────────┘
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ▼
┌─────────────────────────────────────────────────────────────────┐
│ &nbsp;4. 预防措施 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;建立监控 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;定期维护 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
│ &nbsp; &nbsp;&nbsp;-&nbsp;文档记录 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; │
└─────────────────────────────────────────────────────────────────┘

10.2 故障排查检查清单

□ 系统信息收集
&nbsp; □ 操作系统版本
&nbsp; □ 硬件配置
&nbsp; □ 已安装软件
&nbsp; □ 最近变更

□ 日志分析
&nbsp; □ 系统日志
&nbsp; □ 应用程序日志
&nbsp; □ 安全日志
&nbsp; □ 事件 ID 分析

□ 资源检查
&nbsp; □ CPU 使用率
&nbsp; □ 内存使用率
&nbsp; □ 磁盘空间
&nbsp; □ 网络连接

□ 服务状态
&nbsp; □ 关键服务运行状态
&nbsp; □ 服务启动类型
&nbsp; □ 服务依赖关系

□ 网络连通性
&nbsp; □ 本地连接
&nbsp; □ 网关连接
&nbsp; □ DNS 解析
&nbsp; □ 外网连接

□ 权限验证
&nbsp; □ 用户权限
&nbsp; □ 文件权限
&nbsp; □ 服务权限

□ 修复验证
&nbsp; □ 问题是否解决
&nbsp; □ 系统是否稳定
&nbsp; □ 性能是否恢复

十一、常用故障排查命令速查表

| | | | | | — | — | — | — | | 故障类型 | 首要命令 | 辅助命令 | 修复命令 | | 系统启动 | bcdedit | msconfig | sfc /scannow | | 蓝屏 | !analyze -v | wmic recoveros | chkdsk /f /r | | 系统慢 | tasklist | resmon | DISM /RestoreHealth | | CPU 高 | tasklist /v | typeperf | taskkill | | 内存高 | wmic OS | resmon | 重启服务 | | 磁盘满 | wmic logicaldisk | powershell 查找 | cleanmgr | | 网络不通 | ping | tracert | netsh reset | | DNS 问题 | nslookup | ipconfig | ipconfig /flushdns | | 服务失败 | sc query | eventvwr | sc start | | 权限错误 | whoami | icacls | takeown | | 文件损坏 | sfc | DISM | DISM /RestoreHealth | | 驱动问题 | driverquery | verifier | pnputil |


免责声明:

本文所载程序、技术方法仅面向合法合规的安全研究与教学场景,旨在提升网络安全防护能力,具有明确的技术研究属性。

任何单位或个人未经授权,将本文内容用于攻击、破坏等非法用途的,由此引发的全部法律责任、民事赔偿及连带责任,均由行为人独立承担,本站不承担任何连带责任。

本站内容均为技术交流与知识分享目的发布,若存在版权侵权或其他异议,请通过邮件联系处理,具体联系方式可点击页面上方的联系我

本文转载自:运维星火燎原 刘军军 刘军军《Windows 系统故障排查命令详解》

评论:0   参与:  0