本文目录导读:

PowerShell 脚本(推荐)
# 获取所有系统还原点 Get-ComputerRestorePoint | Format-Table -AutoSize # 或者获取更详细的信息 Get-ComputerRestorePoint | Select-Object SequenceNumber, Description, CreationTime, EventType # 导出到CSV文件 Get-ComputerRestorePoint | Export-Csv -Path "C:\RestorePoints.csv" -NoTypeInformation
VBScript 脚本
' 获取系统还原点列表
strComputer = "."
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default")
Set colItems = objWMIService.ExecQuery("SELECT * FROM SystemRestore")
For Each objItem in colItems
WScript.Echo "还原点编号: " & objItem.SequenceNumber
WScript.Echo "描述: " & objItem.Description
WScript.Echo "创建时间: " & objItem.CreationTime
WScript.Echo "事件类型: " & objItem.EventType
WScript.Echo "-----------------------------------"
Next
CMD 批处理脚本
@echo off echo 系统还原点列表: echo ===================== WMIC /Namespace:\\root\default Path SystemRestore Get SequenceNumber,Description,CreationTime /Format:Table pause
更详细的PowerShell脚本(含错误处理)
# 获取系统还原点列表(增强版)
try {
$restorePoints = Get-ComputerRestorePoint -ErrorAction Stop
if ($restorePoints.Count -eq 0) {
Write-Host "未找到系统还原点。" -ForegroundColor Yellow
} else {
Write-Host "找到 $($restorePoints.Count) 个系统还原点:" -ForegroundColor Green
Write-Host "========================================"
foreach ($point in $restorePoints) {
$creationDate = $point.CreationTime.ToString("yyyy-MM-dd HH:mm:ss")
Write-Host "编号: $($point.SequenceNumber)"
Write-Host "描述: $($point.Description)"
Write-Host "创建时间: $creationDate"
Write-Host "事件类型: $($point.EventType)"
Write-Host "------------------------"
}
}
} catch {
Write-Host "获取系统还原点时出错: $_" -ForegroundColor Red
Write-Host "请以管理员权限运行此脚本。" -ForegroundColor Yellow
}
运行说明
-
PowerShell脚本:
- 保存为
.ps1文件 - 右键点击 → "使用PowerShell运行"
- 或打开PowerShell(以管理员身份),运行
.\脚本名.ps1
- 保存为
-
VBScript脚本:
- 保存为
.vbs文件 - 双击运行或在CMD中执行
cscript 脚本名.vbs
- 保存为
-
批处理脚本:
- 保存为
.bat或.cmd文件 - 双击运行
- 保存为
注意事项
- 某些脚本需要管理员权限才能访问系统还原信息
- 如果系统还原功能被禁用,脚本可能无法获取任何还原点
- 不同Windows版本的系统还原API可能略有差异,但上述脚本在Windows 10/11上均可正常工作
这些脚本会显示还原点的编号、描述、创建时间和事件类型,帮助您了解系统的还原点状态。