• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1122
  • Last Modified:

Where to see why Windows 7 PC shut down?

I would like to see how my PC shutdown?  

Was it due to Power Failure, Software Updates caused Reboot, User click on Shut down, etc.

Where do I find this type of information?

I want to write a program, that when the coputer starts back up sends an email but only if it was a power failure that caused it to shutdown.

I have the computer set to boot when power is returned.  I don't want the email if it was due to Software Update, or User issued restart / shutdown.  (Clean Shutdown).

Thanks,
0
Rog D
Asked:
Rog D
  • 4
  • 3
  • 2
  • +1
1 Solution
 
bit_rotCommented:
If you have a power failure, the machine won't know or have a chance to log an event like that since it abruptly shut off.

For other items like updates you can do this:

Look in the event viewer > System log for Event ID 6006 (6005 is start up) note the time, then compare to the other logs (Application) and see what was going on at that time.
0
 
Rog DManager Inforamtion SystemsAuthor Commented:
I belive when it comes up it should know if it was shut down cleanly or not.  I just don't know where to see this?
0
 
McKnifeCommented:
Hi.

in the event log. Press winkey+r then enter eventvwr. Open the log called "system" and look what events get produced at shutdown times. Also have event viewer search for event 6008 which indicates this:
The previous system shutdown at Time on Date was unexpected.

And yes, if the computer boots it will indeed tell you whenever the last shutdown was unexpected, too, right away before it starts doing the swirling color balls.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
databoksCommented:
In Event Viewer you will see Entries for different types of shutdown.

1. Normal shutdown.
2. Shutdown command recieved(i.e remote shutdown, command)
3. Unexpected shutdown such as Power Failure, crash, blue screen of death.

All this can be found in the Event Vieweren.

Could you please clarify on your goal. What do you mean by this statement?

I want to write a program, that when the coputer starts back up sends an email but only if it was a power failure that caused it to shutdown.

Do you want to start af backup or do you only want to send an Email if the shutdown was unexpected(i.e Power Failure)?

Please clarify.
0
 
McKnifeCommented:
By the way, you don't need to write that program - event viewer offers this natively: you can attach task to events via context menu in event viewer.
0
 
bit_rotCommented:
I belive when it comes up it should know if it was shut down cleanly or not.  I just don't know where to see this?

The machine will know that it went down unexpectedly, however that is all it knows. There can be many reasons why this would happen and doesn't necessarily signify a power loss.

Windows Server for example will actually ask when logging in what the cause of the failure was.

http://www.symantec.com/business/support/library/BUSINESS/ATLAS/images_v1/316712/shutdown.jpg
0
 
Rog DManager Inforamtion SystemsAuthor Commented:
McKnife,

I like your solution with the scheduled Task.

I did try this out and unfortunately it didn't work.  The task was scheduled.  I even logged into the machine to see if the email went.  But to no avail.

I looked at the history and it didn't even run.

The task 6008 however was in the event log when I went to view it.
0
 
McKnifeCommented:
You are correct. 6008 is indeed a special case. It gets logged at a very early point of the boot process when the system is not ready for sending event triggered mails. I should have known because we ran into the same problem. You could of course setup a scheduled task that dumps the events of the event log, parses them and sends an e-mail if 6008 is found. the tolol for this is psloglist.exe (download pstools from microsoft).
0
 
Rog DManager Inforamtion SystemsAuthor Commented:
McKnife,

Thanks for both the possible solution and the knowlege of the workaround.  This sounds like a probably solution.

I am also looking into a small battery backup that might talk to the machine before shutting it down gracefully.  If this is the case It probably can run a program that can A.  Send email stating power was lost, then on boot up a custom program could then send an email stating power was restored if the previous email was found or file was written to.

Thanks.
0
 
Rog DManager Inforamtion SystemsAuthor Commented:
Not the full solution to the problem but a  great start on how to solve the issue.
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

  • 4
  • 3
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now