Mute Sound Volume in WSH in Windows Scripting. I’ve seen this question several times over the past few weeks so I decided to sit down and find a solution. There’s a plethora of reasons why you might want to mute or unmute sound volume from within a WSH script. Until now, there’s been no viable solution. There are several third- party Active. X controls available that offer the ability to mute sound volume; but if you’re like me, you’d much rather have a native way of doing this. Third- party Active. Welcome to Creative Worldwide Support. Get technical help for your Creative products through Knowledgebase Solutions, firmware updates, driver downloads and more. General Where can I get the latest version? The latest version of GoldWave is available on the GoldWave download page. When will the next version be released? X controls hinder script compatibility (and portability) because they are required to be installed on every system. Knowing that neither WScript nor VBScript had a method of doing this, my first instinct was to look at WMI. That was a no- go. WMI allows you to work with sound hardware, but it doesn’t allow you to control it’s functionality. Next, I looked to the command- line. I knew that Sndvol. Sound and Volume control, but it doesn’t provide any useful command- lines. Finally, I decided to look toward some native objects. In many cases scriptable objects like Word and Media Player can offer methods of interacting with the Windows API that are otherwise inaccessible to scripters. Again, no such luck. I had exhausted all of my normal avenues of approach, and, to be honest, was quite ready to beat my head off the wall. I was just about to give in and choose a third- party Active. X or command- line utility when I remembered something: the multimedia keyboard! Windows has native support for multimedia keyboards and these keyboards offer a nifty little Mute button. In short, this means that Windows can detect (and respond) to that particular key code. My problem then became: How on earth do I simulate that keystroke? Information: System Requirements: Runs on Microsoft Windows 7, Windows Vista, Windows XP and 2000. Including 32-bit & 64-bit versions. Download size: 3.4 MB.Anytime you’re working with keystrokes you should be thinking of the Wsh. Shell object’s Send. Keys method. However, we’ve been told that it only accepts predefined string values–namely, common alphanumeric characters and some predefined symbolic names. This got me to thinking. How does this function really work. The Send. Keys method accepts can accept a string characters. This would indicate that it iterates through each of those characters. Logically, that would indicate that it’s functionality is based on character codes, rather than the specific characters themselves. So I decided to try it. A little research revealed that the character code for the Mute button was 0x. AD (or decimal 1. Set Wsh. Shell = Create. Object(. This is commonly used to return non- printable characters, which conveniently enough is exactly what we need here. You can see above that I’m simply passing the result of the Chr() function directly to the Send. Keys method. Voila! This code will toggle the sound volume on and off. WaveCart 5.1 Pro WaveCart 5.1 is the latest version of BSI's award-winning, original on-screen cart-machine replacement that's being used by thousands of broadcasters. Description. Fix Your Windows 10 Sound Card Problems with Driver Restore. Driver Restore scans your PC for missing, corrupt, and outdated Windows 10 Sound Card. Windows Vista/Windows XP: Test the Microphone. Click Start, point to Programs, point to Accessories, and then click Sound Recorder. In Windows XP, you will need to.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
March 2018
Categories |