@echo off setlocal EnableDelayedExpansion title Soft'n Sol SSD/NVMe SMART Health Checker color 0B echo. echo ============================================================ echo Soft'n Sol Inc. echo SSD/NVMe SMART HEALTH CHECKER echo ============================================================ echo. :: Check for admin net session >nul 2>&1 if %errorLevel% NEQ 0 ( echo Requesting administrator privileges... echo Please click YES on the UAC prompt. echo. timeout /t 2 >nul powershell -Command "Start-Process '%~f0' -Verb RunAs" exit ) echo Scanning drives... echo. :: Run PowerShell commands directly powershell -ExecutionPolicy Bypass -NoProfile -Command "$disks = Get-PhysicalDisk; foreach ($disk in $disks) { Write-Host ''; Write-Host 'DRIVE:' $disk.FriendlyName -ForegroundColor Green; Write-Host '================================================' -ForegroundColor Gray; Write-Host ''; Write-Host ' Model:' $disk.Model; Write-Host ' Type:' $disk.MediaType; Write-Host ' Bus:' $disk.BusType; $sizeGB = [math]::Round($disk.Size / 1GB, 2); Write-Host ' Capacity:' $sizeGB 'GB'; Write-Host ' Serial:' $disk.SerialNumber; Write-Host ''; Write-Host ' HEALTH STATUS:' -ForegroundColor Cyan; Write-Host ' ----------------------------' -ForegroundColor Gray; $health = $disk.HealthStatus; Write-Host ' Health:' -NoNewline; if ($health -eq 'Healthy') { Write-Host ' '$health -ForegroundColor Green } else { Write-Host ' '$health -ForegroundColor Red }; Write-Host ' Status:' $disk.OperationalStatus; try { $smart = Get-StorageReliabilityCounter -PhysicalDisk $disk -ErrorAction SilentlyContinue; if ($smart) { Write-Host ''; Write-Host ' SMART DATA:' -ForegroundColor Cyan; Write-Host ' ----------------------------' -ForegroundColor Gray; if ($smart.Temperature) { $temp = $smart.Temperature; Write-Host ' Temperature:' -NoNewline; if ($temp -gt 70) { Write-Host ' '$temp'C' -ForegroundColor Red } elseif ($temp -gt 50) { Write-Host ' '$temp'C' -ForegroundColor Yellow } else { Write-Host ' '$temp'C' -ForegroundColor Green } }; if ($smart.PowerOnHours) { $hours = $smart.PowerOnHours; $days = [math]::Round($hours / 24, 1); Write-Host ' Power On:' $hours 'hours ('$days' days)' }; if ($smart.ReadErrorsTotal -ne $null) { Write-Host ' Read Errors:' -NoNewline; if ($smart.ReadErrorsTotal -gt 0) { Write-Host ' '$smart.ReadErrorsTotal -ForegroundColor Red } else { Write-Host ' '$smart.ReadErrorsTotal -ForegroundColor Green } }; if ($smart.WriteErrorsTotal -ne $null) { Write-Host ' Write Errors:' -NoNewline; if ($smart.WriteErrorsTotal -gt 0) { Write-Host ' '$smart.WriteErrorsTotal -ForegroundColor Red } else { Write-Host ' '$smart.WriteErrorsTotal -ForegroundColor Green } }; if ($smart.Wear -ne $null) { $wear = $smart.Wear; Write-Host ' Wear Level:' -NoNewline; if ($wear -gt 80) { Write-Host ' '$wear'%%' -ForegroundColor Red } elseif ($wear -gt 50) { Write-Host ' '$wear'%%' -ForegroundColor Yellow } else { Write-Host ' '$wear'%%' -ForegroundColor Green } } } } catch { Write-Host ' (Limited SMART data)' -ForegroundColor Gray }; Write-Host ''; }; Write-Host '================================================' -ForegroundColor Gray; Write-Host ''; Write-Host 'Scan Complete!' -ForegroundColor Green" echo. echo. echo ================================================ echo FINISHED! echo ================================================ echo. echo Press any key to close this window... pause >nul