Microsoft KB Archive/142616

= Adding Users and Groups During Unattended Setup =

Article ID: 142616

Article Last Modified on 11/1/2006

-

APPLIES TO


 * Microsoft Windows NT Workstation 3.5
 * Microsoft Windows NT Workstation 3.51
 * Microsoft Windows NT Server 3.5
 * Microsoft Windows NT Server 3.51

-



This article was previously published under Q142616



SUMMARY
Adding users and groups during unattended setup of Windows NT does not seem possible with the standard options provided by the unattended answer file Unattend.txt. However, modifying the system hive before running an unattended setup allows you to add a service that will do the job during the first system boot after setup.

This solution is used to add users and groups, but it could be used to do any task that cannot be done at setup time.

NOTE: The solution provided here is not supported by Microsoft and is used at your own risk.

WARNING: Using Registry Editor incorrectly can cause serious problems that may require you to reinstall Windows NT. Microsoft cannot guarantee that problems resulting from the incorrect use of Registry Editor can be solved. Use Registry Editor at your own risk.



MORE INFORMATION
To perform the modification described above, complete the following steps:

 Copy the \I386 directory from the Windows NT distribution compact disc to a network share X: On the computer on which you want to install Windows NT, create a directory C:\TEMP and copy the following files, both of which may be found in the Windows NT Resource Kit:

Addusers.exe

Srvany.exe Make a text file C:\TEMP\USERS.TXT that will be used with Addusers.exe (please refer to ADDUSERS documentation for more information). Run the following commands in a batch file:

X:

cd \

attrib -r SYSTEM._

expand -r SYSTEM._

del system._ Run Regedt32.exe in order to modify the system hive. To run Regedt32.exe, do the following:  Select HKEY_LOCAL_MACHINE in HKEY_LOCAL_MACHINE window Choose Registry, Load Hive menu option</li> Enter X:\SYSTEM.</li> Enter FLAT as the key name</li> Select HKEY_LOCAL_MACHINE\FLAT\ControlSet001\Services</li> Insert a new key AddUsersSvc</li> Select HKEY_LOCAL_MACHINE\FLAT\ControlSet001\Services\AddUsersSvc and insert the following values: <ul> DisplayName REG_SZ Add Users Service</li> ErrorControl REG_DWORD 0x1</li> ImagePath REG_EXPAND_SZ C:\TEMP\SRVANY.EXE</li> ObjectName REG_SZ LocalSystem</li> Start REG_DWORD 0x2</li> Type REG_DWORD 0x10</li></ul> </li> Select HKEY_LOCAL_MACHINE\FLAT\ControlSet001\Services\AddUsersSvc and insert a new subkey Parameters. Select the Parameters key and insert the following values (for more information, please refer to Srvany.wri, provided with the Windows NT Resource Kit): <ul> AppDirectory REG_SZ C:\TEMP</li> Application REG_SZ C:\TEMP\ADDUSERS.EXE</li> AppParameters REG_SZ /C USERS.TXT</li></ul> </li> <li>Select HKEY_LOCAL_MACHINE\FLAT</li> <li>Choose Registry, Unload Hive menu option</li></ol>

This will create a service, "AddUsersSvc," that starts automatically at boot time after setup. You may remove this service later.

</li> <li>Finally, Run WINNT32 /U:X:\UNATTEND.TXT</li></ol>

Additional query words: prodnt

Keywords: KB142616

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.