From http://support.microsoft.com/kb/317277: If Windows XP restarts because of a serious error, the Windows Error Reporting tool prompts you…
How can my app know that ‘Windows XP has restarted because of a serious error’?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Note: this is a good question for a code-challenge
Here are some executable codes, but feel free to add other solutions, in other languages:
The uptime might be a good indication:
Now link that information with a way to read the windows event logs, like, say in PowerShell:
And look for the last ‘Save Dump’ messages
As Michael Petrotta said, WMI is a good way to retrieve that information.
Based on the update time, you can make a query like:
to easily spot an event log with a ‘
Save Dump‘ message in it, confirming the crash.More in the
Win32_NTLogEventClass WMI class.Actually, this Microsoft article Querying the Event Log for Stop Events does give it to you (the complete request):