[HELP]Alarm in batch program

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
bambulization
Posts: 1
Joined: 30 Mar 2015 04:41

[HELP]Alarm in batch program

#1 Post by bambulization » 30 Mar 2015 04:50

So my teacher gave us this problem: create a batch program that will warn me when the school hour is ending, so I have some time to save all my work. Now, my question is, how can i make a program thet waits till a certain time to do something (in this case printing a bell character)?
Thanks in advance! :D

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

Re: [HELP]Alarm in batch program

#2 Post by foxidrive » 30 Mar 2015 06:28

You can parse the output of the %time% variable and loop until it is the time you need.

ShadowThief
Expert
Posts: 1166
Joined: 06 Sep 2013 21:28
Location: Virginia, United States

Re: [HELP]Alarm in batch program

#3 Post by ShadowThief » 30 Mar 2015 08:07

foxidrive wrote:You can parse the output of the %time% variable and loop until it is the time you need.

Expanding on that, I've found that it's best to wait two seconds between loop iterations, otherwise your CPU utilization skyrockets.

That said, I think this problem would be best suited to be solved simply by using the Task Manager and scheduling it to run at the end of the school day.

Post Reply