Jump to content

I made a little program to create a popup as soon as specified amount of minutes have passed because I was waiting for pizza to bake in oven. So far so good. But how can I make it into an alert with sound, kind of like error popups in windows.

@echo off
set /P timemin=Give minutes.
set /A time=%timemin% * 60
timeout /T %time%
msg * "Wakeup!"

 

My stuff:

Spoiler

CPU :  Intel i5 8400 | GPU : MSI GTX 970 Gaming 4GB

 

RAM : 32GB Corsair Vengeance DDR4 @ 3600MHz

 

Mouse : Logitech G502 HERO SE | Keyboard : Mountain Everest Max w/ Cherry MX Brown

 

Headset : Beyerdynamics DT990 Pro 250Ω w/ AT2020USB+

 

Monitor : Acer XF240H @  144Hz

 

Link to comment
https://linustechtips.com/topic/750820-make-alert-message-with-sound-in-batch/
Share on other sites

Link to post
Share on other sites

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to post
Share on other sites

On 3/11/2017 at 1:44 PM, Underi said:

I made a little program to create a popup as soon as specified amount of minutes have passed because I was waiting for pizza to bake in oven. So far so good. But how can I make it into an alert with sound, kind of like error popups in windows.


@echo off
set /P timemin=Give minutes.
set /A time=%timemin% * 60
timeout /T %time%
msg * "Wakeup!"

 

The simplest way would be to have the terminal echo the ASCII control code for BELL (0x7, and I made the beep happen 10 times with a 1 second delay, as well, modify to suit your needs):
 

@echo off
set /P timemin=Give minutes.
set /A time=%timemin% * 60
timeout /T %time%
msg * "Wakeup!"
@echo on
@echo off
for /l %%x in (1, 1, 10) do (
   echo  
   timeout 1
)

You'll need to generate the (Ctrl+G) from the command line though, because Windows command prompt is fucking stupid. See http://stackoverflow.com/questions/1143386/in-a-bash-script-command-how-can-i-make-a-pc-beep-noise-or-play-a-sound-file

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×