Unattended (or cmdline) audio driver install

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.

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jmj050997Author Commented:
Edited text of question
jmj050997Author Commented:
Adjusted points to 313
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
Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

jmj050997Author Commented:
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...


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.

jmj050997Author Commented:
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.

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.
jmj050997Author Commented:
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........

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.

jmj050997Author Commented:
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...
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:

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.


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
jmj050997Author Commented:
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 ....

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Windows OS

From novice to tech pro — start learning today.

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.