We help IT Professionals succeed at work.
Get Started

Script to add default sound card settings for new users

ditobot asked
Last Modified: 2012-05-09
I have an audio PC running Windows XP SP3 that has a multi-input sound card and I need to create a logon script that will set the proper default values. I am savvy enough to edit pre-existing scripts but am very limited in my scripting abilities.

I have sort of stumbled half way onto the proper script but I am having problems createing the entire structure in the registry. Apparently the Sound Mapper settings don't get created in the registry until the user goes into control panel and changes what comes up by default so it appears that I will have to create the entire Sound Mapper registry directory for new users.

So far I have a script to add the proper strings for my sound card but I can't figure out how to add the proper REG Dword values to complete the field.

Here is what the completed registry directory should look like:

HKCU/Software/Microsoft/Multimedia/Sound Mapper:

(Default)                                            REG_SZ            (Value Not Set)
ConsoleVoiceComPlayback                REG_SZ            LynxONE Digital Out
Playback                                            REG_SZ            LynxONE Digital Out
PrefferredOnly                                   REG_DWORD    0x00000000(0)
Record                                               REG_SZ            LynxONE Digital In
SetupPreferredAudioDevicesCount   REG_DWORD    0x00000000(0)

I have managed to find a script that will add REG_SZ values, one at a time but I would prefere a script that would create everything in one script. Here is the script I am using to create a single REG_SZ value.

strSetTo = "LynxONE Digital Out"

Set wshShell = CreateObject("WScript.Shell")
strRegVal = "HKEY_CURRENT_USER\Software\Microsoft\Multimedia\Sound Mapper\Playback"

strSetting = ""
On Error Resume Next
strSetting = wshShell.RegRead(strRegVal)
On Error Goto 0

If strSetting <> strSetTo  Then
    wshShell.RegWrite strRegVal, strSetTo
End If

If there is a better way to go about setting default audio card settings for all users on a single machine then I am all ears. Either way, thanks in advance for any help.
Watch Question
This problem has been solved!
Unlock 1 Answer and 2 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE