Thursday, November 6, 2008

Quckly create a shortcut key to mute / un-mute Windows sound volume

OK, in some previous post I described how to mute Windows using a simple Vbscript file. Then I wrote another post, where I described how to create a hotkey in Windows to mute sound. But, I realize some of you are not interested in how I did it. So are you looking for any easy way to add a keyboard shortcut (hotkey) to mute the sound? Well, for everyone that just wants the quickest way to create a hotkey to mute and unmute Windows I give you... MakeMuteShortcut.vbs. When you click the MakeMuteShortcut.vbs link the Microsoft Windows 'File Download Security Warning' will display and give you a choice of Open, Save, or Cancel.

When you click Open, Windows will display another warning similiar to below...

Click 'Run'. After you click Run, you'll notice that there is a new shortcut icon on your desktop named 'mute'. That's a good indication things went as planned. Now press CTRL + SHIFT + M and Window's volume will be muted. Press the hotkey and again and it will un-mute the sound.

In case you are wondering what weird science took place in the MakeMuteShortcut.vbs, here's the contents...

' by http://frontierdg.blogspot.com
' enjoy :)
set oShell = CreateObject"WScript.Shell")
strDesktop = oShell.SpecialFolders("Desktop")
set fso=createobject("Scripting.fileSystemObject")
set ofile=fso.CreateTextFile(strDesktop & "\mute.vbs",true)
ofile.writeline "set oShell = CreateObject(" & chr(34) & "WScript.Shell" & chr(34) & ")"
ofile.writeline "oShell.SendKeys chr(173) 'mute/ un-mute the sound"
ofile.close

set oShellLink = oShell.CreateShortcut(strDesktop & "\mute.lnk")
oShellLink.TargetPath = strDesktop & "\mute.vbs"
oShellLink.WindowStyle = 1
oShellLink.Hotkey = "CTRL+SHIFT+M"
oShellLink.Description = "Toggle Mute"
oShellLink.WorkingDirectory = strDesktop
oShellLink.Save

...

That's all there is to it. Enjoy :)

No comments:

Post a Comment