Previous boot time

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
danbenedek
Posts: 1
Joined: 09 Feb 2012 01:02

Previous boot time

#1 Post by danbenedek » 09 Feb 2012 01:06

I have found a way to get the boot time like "systeminfo | find /i "boot time""
But in order to run this command the user must be logged on.

Is there a way to get the previous boot time?

Liviu
Expert
Posts: 470
Joined: 13 Jan 2012 21:24

Re: Previous boot time

#2 Post by Liviu » 09 Feb 2012 21:25

It's not clear what you mean by "previous". If it's the most recent reboot you can still use systeminfo even before the first login (lookup the /U /P switches). If it's about some prior reboot, then you could probably use WMI to scan the event log. In either case, a batch file may not be the best/easiest way to do it, though.

Liviu

Post Reply