If you are scripting or prefer command line, you can query the event logs directly.
Go to: Event Viewer (Local) → Windows Logs → System where to check memory diagnostic results
The most reliable way to check your memory diagnostic results is through the Event Viewer, which maintains a permanent log of the test outcome. I can't find memory diagnostic results in Event viewer. If you are scripting or prefer command line,
Alternatively, you can also use the tool to view the results: where to check memory diagnostic results