473,385 Members | 1,830 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Finding out how the machine last rebooted and when.

UJ
How can I find out when the machine last rebooted and where it was a system
crash or an regular reboot.

This would be on XP.

TIA - Jeff.
Sep 20 '06 #1
3 1747
"UJ" <fr**@nowhere.comwrote in message
news:eR**************@TK2MSFTNGP03.phx.gbl...
How can I find out when the machine last rebooted and where it was a
system crash or an regular reboot.
As far as I know, the C# language doesn't provide any built-in mechanism for
getting that information.
Sep 20 '06 #2
You should write some code to check the operating system event log.
On windows 2003 each time you reboot your computer a new entry is added
to the system log with event id 1074, but on XP you may have to enable
this service since it usually comes disabled.

You can find info on how to enable de Shutdown event tracker here...
http://support.microsoft.com/default...b;en-us;293814

That would cover a graceful shutdown

And if by a system crash you mean bsod there is an event entry too i'm
not very sure right now but i think its event id 1003

Hope it helps

UJ wrote:
How can I find out when the machine last rebooted and where it was a system
crash or an regular reboot.

This would be on XP.

TIA - Jeff.
Sep 20 '06 #3
Torcaza <cg*****@gmail.comwrote:
You should write some code to check the operating system event log.
On windows 2003 each time you reboot your computer a new entry is added
to the system log with event id 1074, but on XP you may have to enable
this service since it usually comes disabled.

You can find info on how to enable de Shutdown event tracker here...
http://support.microsoft.com/default...b;en-us;293814

That would cover a graceful shutdown
System.Diagnostics.EventLog.
--
Thomas T. Veldhouse
Key Fingerprint: 2DB9 813F F510 82C2 E1AE 34D0 D69D 1EDC D5EC AED1
Sep 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: John | last post by:
Hi. We had a PC that had Oracle Client 8.0.5 and 8.1.7 installed in Default_Home (c:\orant) and Default_Home1 (c:\oracle). A third party package, installed certain components of Oracle Client...
32
by: someone else | last post by:
hi all I'm a newbie to this group. my apologies if I break any rules. I've wrote a simple program to find the first 1,000,000 primes, and to find all primes within any range (up to 200 *...
6
by: Mikey_Doc | last post by:
Hi We are running cms 2002, Framework 1.0 with Visual studio 2002. We have just upgraded to Framework 1.1 and visual studio 2003. All of our database connection strings are stored within the...
3
by: Joe Kimbler | last post by:
I'm writing a "Hot Directory" software package that watches for an MP3 file to be uploaded to an FTP directory. When the file has completed uploading, it will be converted into a WAV file and...
9
by: dave m | last post by:
I need to be able to retrieve a unique ID from a users PC. I needs to be something a user could not easily change, like the computer name. Could someone point me in the right direction to find ...
9
by: Laurent Bugnion | last post by:
Hi, I am wondering what is the best way to find out which ASP.NET sessions are still active. Here is the reason: I have a custom control which can upload files. It saves the files in a folder...
0
by: Artie | last post by:
I have moved SQL 2000 to new hardware several times following various 'approved' procedures with success. I have a customer who did the following and it seems to work (although very minimal...
12
by: Jeff | last post by:
As I'm learning PHP, I'm making a fair number of mistakes in syntax. In perl, you can turn on reading these errors from the browser by adding this: use CGI::Carp 'fatalsToBrowser'; Is there...
275
by: Astley Le Jasper | last post by:
Sorry for the numpty question ... How do you find the reference name of an object? So if i have this bob = modulename.objectname() how do i find that the name is 'bob'
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.