Many modern keyboards have a special key for muting/unmuting the sound in Windows, but if yours doesn’t, you can create the next best thing with a PTFB Pro macro and a couple of lines of script. Here’s how to go about it.
Stage 1 – create mute/unmute script
The first stage is to create a little “.vbs” script that will toggle the sound on/off. Just open up Notepad (or your favorite text editor) and paste in the following two lines of text:
Set oShell = CreateObject("WScript.Shell")
oShell.SendKeys(chr(&hAD))
Save the file somewhere convenient, with the .vbs extension. For example, I called mine “Mute.vbs” and popped it in my documents folder. Double-click it a couple of times just to make sure it works and you haven’t made a typo anywhere.
Stage 2 – create PTFB Pro macro and bind to hotkey
OK, now we’ve got our script, we’re going to create a PTFB Pro macro to run it, and bind that macro to a hotkey.
- Create a new screen based macro and stop recording immediately by hitting the Pause/Break key.
- Open the new macro for editing. On the General page, give it a meaningful name (e.g. “Mute”).
- Switch to the Triggers page and turn off “Trigger spontaneously”. Now tick “Hotkey” and choose a memorable hotkey combination for the mute function. CTRL + SHIFT + M sounded good to me.
- Switch to the Editing page. Clear out any existing recorded actions and add just a single “Run Executable” item. For the command line, type in “cscript” followed by a space, followed by the full path to the vbs file you created earlier. If the path contgains spaces, remember to surround it with double quotes.
That’s it. Your chosen hotkey will now execute the vbs file, toggling Windows audio between its muted and unmuted states.
Find out more about boosting your productivity with autoclicks and macros.
CLICK HERE to download a free 30 day trial, no strings attached. If you aren’t entirely happy simply uninstall!