VBScript or other language to adjust advanced Xp volume settings

Does anyone know of a programming solution to adjust the advanced volume settings in a Windows XP Pro machine that does not involve using the "SendKeys" function to emulate keystrokes?  That solution doesn't always work, and takes too long as the script is being processed.

The settings I'm referring to can be manually edited by going to the Control Panel -> Sounds and Audio Devices -> Advanced.  Once there, the settings I need to adjust are for:

Speaker, Wave, SW Synth, CD Player

I and my collegues have looked around on Microsoft and other's sites for an extremely long time and have not found a way to do this.  I'm hoping a windows guru out there has had to do just this thing before and can make us feel silly by not finding it sooner.  Surely there must be some registry key or something to edit for these, but I can't find it.  Any reliable, quickly executing, programming solution in any language would be an acceptable answer.  Using the sendkey's function doesn't work reliably, as to adjust this it takes a long time as .NET, VB and VBScript programs process the commands to lower the scrollbars.  I really need something that can set the values by sending a specific command or number and not by looping a specific number of times.

Thanks for ideas and help!  If there's no solution by April 30 the most creative programming attempt not using SendKeys gets the points, but the attempt must be in good faith and not be just garbage.  Please help and good luck!
Who is Participating?
This is gonna take a wee bit of experimentation to get it right.

Basically you can edit the registry directly to obtain the same effect as the a human moving the slide controls...  The trick is finding the correct device ID and the channel number that corresponds to the Speaker, Wave, etc

Here's what you need to do...  

Start with opening the registry editor and navigate to:

One of the keys below this point will have a key called "#WAVE\Control"
And it will have a DWORD value called "Linked"\
Just poke around in each key until you find it

Now, you've discovered the Device ID part of the puzzle... it will be insanely long (in my case the key is: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{6994AD04-93EF-11D0-A3CC-00A0C9223196}\##?#PCI#VEN_1106&DEV_3059&SUBSYS_812A1043&REV_60#3&267A616A&0&8D#{6994ad04-93ef-11d0-a3cc-00a0c9223196})

OK, next we need to discover the mapping of the channel numbers to the control sliders...  This will take a bit of experimentation.  For example, when I changed the Wave volume on my PC, the values for "Channel0" and "Channel1" changed at:
<insanely long key>\#Wave\Device Parameters\Mixer\2\Controls\0
So, that means channel 2 is for the "Wave" slider (on my system)... you'll need to test each one to find the slider-to-channel match

After you've mapped the channels, you can create a registry file that can easily be scripted (or just double-clicked on) to immediately adjust the volumes).  It would look like this (with idential entries for the other "channels", ie : Speaker, SW Synth, and CD Player

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\DeviceClasses\{6994AD04-93EF-11D0-A3CC-00A0C9223196}\##?#PCI#VEN_1106&DEV_3059&SUBSYS_812A1043&REV_60#3&267A616A&0&8D#{6994ad04-93ef-11d0-a3cc-00a0c9223196}\#Wave\Device Parameters\Mixer\2\Controls\0]
thinkscriptAuthor Commented:
Oh....this will be so ugly since it has to run on any machine.  Still, I think using substrings and alot of loops it will work for me.

Thanks for the tip.  It's definitely the right direction for this problem and looks really promising.
thinkscriptAuthor Commented:
So much more work to actually turn this into a programmable solution though...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.