Unattended (or cmdline) audio driver install

Posted on 1997-05-29
Last Modified: 2013-12-28
I have to setup many NT workstations unattended. I have no
problem with the video drivers, network drivers ... even those that don't support unattended installation: I successfully modified their oemsetup.inf.

ONE PROBLEM REMAINS: audio drivers.

I know the unattended setup doesn't support them. I used the sysdiff tool to install them by removing the ENUM line in the sysdiff.ini, but I don't think it's a good method because the generated inf file SIMPLY REPLACES the ENUM\HTREE\ROOT key by the value found while I launched the SYSDIFF, instead of adding the necessary LEGACY_DRIVER at the end of the value.

A solution might be to call the installer from the mmsys.cpl via command line parameters but I did not succeed.
I found that calling
RUNDLL32 SHELL32.DLL,Control_RunDLL mmsys.cpl,,4 launches the right applet, but that's all.
I also found a MediaClassInstaller function in mmsys.cpl, but I couldn't run it. I tried
RUNDLL32 MMSYS.CPL MediaClassInstaller Path\.inf InfOption
but it didn't work.

If anyone has a solution to install an audio driver via the command line, I would be very happy to hear from you.

Question by:jmj050997
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 7
  • 5

Author Comment

ID: 1778672
Edited text of question

Author Comment

ID: 1778673
Adjusted points to 313

Expert Comment

ID: 1778674
jmj, this is the only way I can think of getting in contact with you.  The question you answered for me regarding getting NET time on the Workstation, which I left unlocked for further answers has now expired.  I do however want to do the right thing and give you the points you deserve.  What is the best way to do this?  Do you want me to post a dummy question in a particular area for you to answer?regards Andrew
Secure Your WordPress Site: 5 Essential Approaches

WordPress is the web's most popular CMS, but its dominance also makes it a target for attackers. Our eBook will show you how to:

Prevent costly exploits of core and plugin vulnerabilities
Repel automated attacks
Lock down your dashboard, secure your code, and protect your users


Author Comment

ID: 1778675
No thanks, I don't really care for points... I just want a better automatic installation procedure for nt, no more blue screens, and a pint of Guiness...



Expert Comment

ID: 1778676
ajpawels: After expiring they have an autograding that gives jmj a "B" or nowerdays a "C" if the answer make sense.

jmj: Are you sure you used SYSDIFF correctly ?
I suggest the following:
- start: sysdiff /snap before.inf
- install the drivers
- start: sysdiff /diff before.inf new.dif
- start: sysdiff /inf new.dif \temp

(if the new driver needs to reboot you can /diff before and after reboot)

this creates $OEM$ in \temp
From there you see which files were copied and which registry settings were changed. Of course not all settings are necesary, but you can easyly see which one belong to the driver setup.

This must work.


Author Comment

ID: 1778677
I know this works BUT the generated $OEM$\XXX.INF has a command that REPLACEs the ENUM\HTREE\Root\AttachedComponents KEY by the key found when sysdiff /diff was launched instead of simply ADDING the modification at the end of the value. SYSDIFF considers a REG_MULTI_SZ value as a whole and cannot generate a .INF that adds a new SZ at the end of a MULTI_SZ value.

This is a general problem with REG_MULTI_SZ keys. An other example is the Services\EventLog\Application\Sources KEY.


 Computer A, CCS\Enum\Htree\Root\ac\0 = LEGACY_A1,LEGACY_A2
 Computer B, CCS\Enum\Htree\Root\ac\0 = LEGACY_B1,LEGACY_B2

On Computer A:
    - I use sysdiff /snap,
    - install my NEWDRV
    - launch sysdiff /diff
    - sysdiff /inf /m  --> I get a $oem$ with xxx.inf that reads


Now what ? If I apply this XXX.INF to Computer B,

I get
Computer B, HKLM\SYSTEM\CCS\Enum\Htree\Root\AttachedComponents =                    LEGACY_A1,LEGACY_A2,LEGACY_NEWDRV


Then Computer B SEEMS TO work well for a while, but blue screens are not far away cuz an important part of the system registry is incorrect.

What I want is to launch a .BAT that adds an audio driver correctly on any computer: the .BAT should have the same effect on the system as the ControlPanel/Multimedia/AddDriver Applet.

I did it with the Sound Blaster AWE32 cards using the tool devpre.exe (hidden in the sp3 distrib) but this method only works with PNPISA soundboards.

BTW an other problem: Anyone successfully sysdiffed Delrina Fax Pro 8.0 ???? I always get an error message saying the modem is not set correctly when I apply the generated .INF.


Expert Comment

ID: 1778678
Now I understan you!
I never run into this problem because I didn't remoce ENUM from the INI and didn't install soundcards.
What you are looking for is registry editor that adds something to a muli_SZ.

Which utilities did you try sofar?

Maybe with kixtart you can first get the actual value, then add your string and finaly set the result.

I didn't instal any FAX software.

Author Comment

ID: 1778679
I tried everything I could (KiXtart, ResKit, ...) BUT the problem is that only the SYSTEM has write access to this key. The Administrator (or equivalent) only has read access.

I'm just finishing to code (C++) a reggrant.exe that may help...but the best would be to find a way to call the real MediaInstall routine, passing the INF and OPTION........


Expert Comment

ID: 1778680
If only system has access, you are sure the INF in $OEM$ is applied? If yes, what about this:
Use a common utility to extract the actual ENUM key.
Use a small selfwritten programm or script to put the contents of the key found + the new value to add into a new INF file. I mean you have a INF file ready:


a swap programm now exchanges $$DUMMY$$ with the actual value.

Then use the command from cmdlines.txt to apply the INF.

This way I did a lot userspecific configuration with WFW311.

Next idea:
You may be able to install using a macro utility which presses all te desired keys for you.


Author Comment

ID: 1778681
A Macro Utility is a good idea too. I tried WinBatch... it works but I must get a license (...) AND install a lot on the workstation before being able to use it.

The next macro utility i'm looking for is mstest.exe ... but I don't know where to find it and its documentation...

Expert Comment

ID: 1778682
And what about my first idea. Did you tried it already. May it work?

Mstest is inside the SDK:

it seems to be freeware since it is included elsewhere like:


Accepted Solution

cer earned 410 total points
ID: 1778683
I think one of the SYSDIFF answers in my comments must work.

With sysdiff determine what entries you need to add.
The only problem one is the multi_sz entry. To solve this you must know the specific entries after the normal install. You must extract them after install and before running your INF file.
You must include the extracted values in your new INF at runtime.
I think all this can be easiely done by
regedit /e  to dump the registry to a file and then use "find" and "copy".

Best would be a multi_sz changing utility of course.
sounds very promising. It has reg_set and reg_get for multi_sz
Did you check perl?

When I understand

correctly there is an official way to specify it directly in the INF file.

Here a short excerpt:

reg-root-string, [subkey], [value-name], [flags], [value]
[reg-root-string, [subkey], [value-name], [flags], [value]]
     Optional. Establishes the value data type and the AddReg item action. The flag value is a bitmap where the low word contains basic flags that define
     the general data type and AddReg item action. The high word contains values that more specifically identify the data type of the registry value. The
     high word is ignored by the 16-bit Windows 95 setup functions in SETUPX.DLL. The flags are defined as follows:
                                  The value is “raw” data.
                                  Do not overwrite the registry key if it already exists.
                                  Delete the value from the registry.
                                  Append a value to an existing value. This flag is currently supported only for REG_MULTI_SZ values.


Author Comment

ID: 1778684
Thank you for your help ! The FLG_ADDREG_APPEND is exactly what I need !

I'm gonna post a new question on NT4 workstation, roaming profiles and .... INI FILES ....


Featured Post

Simple, centralized multimedia control

Watch and learn to see how ATEN provided an easy and effective way for three jointly-owned pubs to control the 60 televisions located across their three venues utilizing the ATEN Control System, Modular Matrix Switch and HDBaseT extenders.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A project that enables an administrator to perform actions within a user session context not just at the time of login but any time later on day(s) or week(s) later.
There are many software programs on offer that will claim to magically speed up your computer. The best advice I can give you is to avoid them like the plague, because they will often cause far more problems than they solve. Try some of these "do it…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question