get boot up time

User avatar
stuck
Panoramic Lounger
Posts: 8163
Joined: 25 Jan 2010, 09:09
Location: retirement

get boot up time

Post by stuck »

In XP Pro a simple ctrl/alt/del included the bootup time in the dialog box that appeared. Handy for me as I work flexitime and although I do try to keep regular hours, my start time tends to vary each day.

In Win 7 you don't get that bootup time with a ctrl/alt/del (I know, loss of useful features is just 'progress'). Googling for a solution turns up various ways of finding it out. Most involve typing a command into a command window (= effort) so I though, easy, I can write a simple BATch file. Except I'm struggling.

All I want is to double click on a .bat file on my desktop and have it:
1) open a command window
3) type 'quser' (no quotes)
4) pause while I note the time
5) close the command window

Can someone help me?

Thanks,

Ken

User avatar
HansV
Administrator
Posts: 78412
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: get boot up time

Post by HansV »

I'm not a batch file expert by any means, but does the following do what you want?

@echo off
quser
pause
Best wishes,
Hans

User avatar
stuck
Panoramic Lounger
Posts: 8163
Joined: 25 Jan 2010, 09:09
Location: retirement

Re: get boot up time

Post by stuck »

Thank you, it does this time.

What I don't understand though is why it didn't work when I tried it (plus several other variations). Probably because I was trying at about 4:55 pm last night, just before I went home yesterday. It's never good to try something new that late in the day.

Ken

User avatar
John Gray
PlatinumLounger
Posts: 5406
Joined: 24 Jan 2010, 08:33
Location: A cathedral city in England

Re: get boot up time

Post by John Gray »

If you want to just look at the time for a certain, well, time then replace the pause by
ping -n <secs> 127.0.0.1 > nul
exit

Replace <secs> by one more than the number of seconds you want it to wait (10 second wait - put 11).
exit closes the Command Prompt window for you.
John Gray

"(or one of the team)" - how your appointment letter indicates you won't be seeing the Consultant...

User avatar
stuck
Panoramic Lounger
Posts: 8163
Joined: 25 Jan 2010, 09:09
Location: retirement

Re: get boot up time

Post by stuck »

John Gray wrote:Replace <secs> by one more than the number of seconds you want it to wait
4 seems about right for me.

Thanks,

Ken