Simple XP tip: Alarm clock
1 October 2007, by Ben 17 comments
I’ve come to quite like XP. But there’s the odd missing feature, like the fact that Windows has no alarm clock. I don’t mean a super-fancy Outlook Calender application, where you have wade through scads of GUI just to get a reminder sound — I mean a simple beep-beep alarm clock.
Then I discovered that XP (especially XP Pro) has a reasonably rich set of command line utilities. Well, not rich if you’re used to Unix-like shutils or txtutils, but rich if you’re from a Windows 95, “the most powerful command is dir /w” type of background.
So of course I wanted my alarm clock. No doubt old news for Unix-heads, but enter the Microsoft version of the at command. (Or the more powerful schtasks, but I think that’s only in XP Pro.)
To get my alarm clock, I first made a batch file which just plays a sound, and stuck it in my path, say, c:\windows. Here’s my alarm.bat that plays an alarm sound using Media Player (put it all on one line):
"c:\Program Files\Windows Media Player\mplayer2.exe" /play /close /new c:\windows\Media\notify.wav
And then when you want to set an alarm, just go to the command line (Start > Run > “cmd”) and type something like:
at 7:30pm alarm
Or, if you want an alarm at 6am every Mon, Wed, and Thu:
at 6am /every:m,w,th alarm
Trivial, I know. But what I like is that you don’t have to download yet another 1.5MB program to do it (like this one or this one).
17 comments (oldest first)
Thanks very much for the tip. BTW, I found I had to make the .bat extension explicit and use a 24-hour clock:
at 19:30 alarm.bat
Hmmm, doesn’t work for me for some reason… How does typing “alarm” in work? That isn’t really a command, but I’ll experiment.
DarthVader, “alarm” isn’t a built-in command, but if you save out a file alarm.bat somewhere in your PATH, as described above, it should work.
Kay, will try it.
I did what you said, but… When I type AT /YES it says
ERROR 1 TOMMOROW 5:53 PM ALARM
And nothing happens. I’m sorry to bug you, but this looks so cool!
I’m not sure, but there’s probably some issue with your alarm.bat or it’s not in your path. Assuming you’ve already created the alarm.bat file, check what happens when you just type “alarm”.
Hmm, I saved it to my desktop. The status reads OK until the time is what I set it to, and then it goes to ERROR. I hope I’m not a bother to you, but I am totally confused…
OH! I understand, you gotta make alarm.bat a custom command, as they call it. OK! Thanks, I’ll try it.
Hmm, is there any way to make ia alarm on the current day? Like, if you’re testing it out? This will probably be my last comment, I just need to know what you do step ny step, and that would be good, thanks (if that’s too muxh that’s ok just don’t respond).
I think if you give any time in the future, it should work fine. So if it’s 1:45pm here now, and you say “at 2:00pm alarm”, it should alarm in 15 minutes. For further details, you’ll probably have to check out the Windows XP “at command” documentation.
sight Oh well, thanks for your help. You were right, but no matter what I do, the status always ends up as ERROR.
I GOT IT!! Thank you so much for your tolerance and helpfulness!
I like this idea for a very simple alarm run out of command prompts – but I would want a (static) pop-up on my screen instead of an audio sound. I’m unfamiliar with batch files, so I’m not sure where to start. Thoughts?
I love the way you wrote this. I am totally the “Windows 95, the most powerful command is dir /w” type… :)
Gonna try it just for that.. Thank you!! :D
Regards, Nonaz
Hi,
xphome sp3 — my alarm.bat written as you say to, is in the same place you put yours, and wmplayer2.exe in the same place, so the parameters are the same. ‘alarm’ produces no sound but this error:
Microsoft Windows XP [Version 5.1.2600]
`C:\Documents and Settings\bri>/play /close /new c:\windows\Media\notify.wav`
‘/play’ is not recognized as an internal or external command, operable program or batch file.
Hi quattrocchi, I’m not sure exactly, but yours looks like it’s trying to execute a program “/play” (because it says “/play is not recognised) when it should be executing wmplayer2.exe, like so:
"c:\Program Files\Windows Media Player\mplayer2.exe" /play /close /new c:\windows\Media\notify.wav





nice tip, i threw my last alarm clock out the window on accident.