New
#10
I tried Option One from a boot UFD. It worked if the UFD was built with a WinRE, but not if built with a WinPE (based on W10 2004). In the latter case, the wmic command was not recognized as valid.
Hello mate,
It should work in a command prompt at boot from a Windows 10 installation USB like below.
FYI - Get-CimInstance -namespace root\wmi -class MSStorageDriver_FailurePredictStatus works for me on Powershell 7.1.3 from github and inbuilt powershell version 5.1.x on 2004 too.
Oh, I see - I missed that.
Get-WmiObject -namespace root\wmi -class MSStorageDriver_FailurePredictStatus
doesn't work for me on PS 7.1.3 either, but works with 5.1.x
As I previously reported, the work around
Get-CimInstance -namespace root\wmi -class MSStorageDriver_FailurePredictStatus
works on both.
Hello @Brink ,
As per your excellent Tutorial, I wrote this some time ago [ Updated for this post ] to extract the information as stated in Options 1, 2, & 3, on aRunning
OS . . .
Code:@echo off if not "%1"=="max" start /max cmd /c %0 max & Exit/b :: ################################################################################################################# :: # Title : Check Drive Health and SMART Status # :: # Created By: Paul Black # :: # Created On: 24-Sep-2021 # :: # Tutorial : https://www.tenforums.com/tutorials/163843-how-check-drive-health-smart-status-windows-10-a.html # :: ################################################################################################################# set "Title=Check Drive[s] Health and S.M.A.R.T. [ Self-Monitoring, Analysis and Reporting Technology ] Status" & set "Author=Paul Black" title %Title% - Written by %Author%. setlocal EnableDelayedExpansion set "params=%*" cd /d "%~dp0" && ( if exist "%Temp%\getadmin.vbs" del "%Temp%\getadmin.vbs") && fsutil dirty query %systemdrive% 1>nul 2>nul || ( echo Set UAC = CreateObject^("Shell.Application"^) : UAC.ShellExecute "cmd.exe", "/k cd ""%~sdp0"" && %~s0 %params%", "", "runas", 1 >> "%Temp%\getadmin.vbs" && "%Temp%\getadmin.vbs" && Exit /b) %windir%\system32\reg.exe query "HKU\S-1-5-19" 1>nul 2>nul || ( echo. & echo ERROR: This Batch file MUST be run in an ELEVATED cmd prompt [ Administrator ] & echo. & echo Right-click the Batch file and click ^<Run as Administrator^>. & echo. & echo ^>Press ANY key to EXIT . . . & pause >nul & Exit ) echo. & echo ################################################################################################################################################################### echo # # echo # %Title% # echo # # echo ################################################################################################################################################################### echo. & echo Processing . . . echo. & echo =================================================================================================================================================================== echo Checking SMART Status of Drive[s] . . . echo =================================================================================================================================================================== echo. & wmic diskdrive get model, name, serialnumber, status echo =================================================================================================================================================================== echo Checking SMART Failure Predict Status of Drive[s] . . . echo =================================================================================================================================================================== echo. & wmic /namespace:\\root\wmi path MSStorageDriver_FailurePredictStatus PowerShell Get-CimInstance -namespace root\wmi -class MSStorageDriver_FailurePredictStatus PowerShell Get-WmiObject -namespace root\wmi -class MSStorageDriver_FailurePredictStatus echo =================================================================================================================================================================== echo. & echo Processing Complete. echo. & echo ^>^> Press ANY key to EXIT . . . & pause >nul & Exit