[Lowerbounds, Upperbounds]

Algorithms are everywhere.

Your laptop just makes the familiar “oh-oh” sound. You know you have an instant message in ICQ.

The problem is, it’s 5:30 in the morning right now… Indeed you forgot to turn off your speaker the night before.

It doesn’t have to be like this.

The one last time this happened to me, I decided to fix this problem once and for all. So I wrote a command line utility that lets me mute and un-mute my computer speaker. Couple this with the Task Scheduler in Windows, my laptop knows when to keep quiet. :)

Usage: cmdmute [0|1]
0 - Mute OFF
1 - Mute ON
Toggle if no argument is given.

Update on 2007-01-30: Source posted. Compile it with cl cmdmute.cpp winmm.lib

Update on 2008-11-11: I use this only on Windows XP and I don’t have Vista for testing.

Update on 2008-12-23: I heard that nircmd works on Windows Vista.

22 Comments

  1. So I was going to google to find out if there was some command I can run to mute the speaker. I didn’t think I’d find anything, let alone an actual application that can easily be put into Windows Tasks. Excellent script! Thanks a lot!

    - Adam

  2. Michael J. Titera
    19:11 on November 11th, 2005

    Great job!

  3. Kevin
    11:59 on June 22nd, 2006

    Thanks for the util.

    One step better would be if the command could be used to report the current setting. That way a script that needs to mute could not unmute if it was mute before the script runs. Maybe:

    cmdmute check

  4. Great program. Thanks.

  5. Edwin
    2:51 on October 20th, 2006

    I have a shared computer in my office and I really want the sound off, while most of my colleagues like the sound on.

    A shortcut to your file in the startup folder and everyone can set his preference. Great! (thanks to google)

  6. Great thing, many thanks to the author! But also could you share the secret - I mean, the original script source?

  7. Great App. I chucked it into a batch script wich runs each time i log on to mute my laptop. No more IM noice in lectures…

    its a simple shortcut on my start menu to unmute it when i want things back on again.

    Thanks!

  8. No problem. See the update above.

  9. Sweet this is exactly what i was looking for :) thanks!

  10. Sweeet!! This is what i was looking for. Thanks for the utility and sharing the code too :-)

    Cheers
    /\/ishanth

  11. Milos
    9:10 on April 4th, 2008

    I was about to write my own, just wanted to check did anyone make it before… I downloaded it, still didn’t check it, but i’m sure it works :)

    Thanks! :)

  12. Thanks for this nice application mate. Very sweet indeed. Thanks loads.

  13. mickey
    11:01 on July 27th, 2008

    thanks so much!
    very appreciated your open-minded :)

  14. Great File man. Can i add a mirror file on my site? It would be bad if the human world will lost this great small tool.

  15. MP
    9:47 on August 22nd, 2008

    Please let me know how to use it. I M a new user. and I do not hv much knwledge :(

    Thanks

  16. rdhoore108
    9:16 on September 25th, 2008

    It doesn’t seem to work in Vista… It doesn’t complain, and says muting is on, but the sound is still on.

  17. rdhoore108
    9:23 on September 25th, 2008

    I found a tool that is able to mute/unmute the sound in Windows Vista. It can also do many other nice things, like changing the volume, opening the CD tray etc.

    http://www.nirsoft.net/utils/nircmd.html

  18. thetootall
    16:54 on November 8th, 2008

    Great tool! This is perfect when I’m trying to listen to music over the media center and my 5 year old refuses to turn the sound down on his PC that’s in the same room :)

  19. vasta41
    16:04 on November 12th, 2008

    Could you please post the original command line code?

  20. Dan
    11:58 on November 16th, 2008

    nice job man! keep goin’

  21. Greg
    10:31 on November 28th, 2008

    This is what i’m looking for, ver big thanks!

  22. Tushar
    17:37 on December 16th, 2008

    Hi,

    Great app mate! I have windows vista. I have tried running this after putting the app in System32 folder…it doesn’t work. Am I doing something wrong?
    Please advise.

    - Tushar