Microsoft KB Archive/186897

= PRB: "Failure Writing to the System Registry" Error Message =

Article ID: 186897

Article Last Modified on 5/13/2003

-

APPLIES TO


 * Microsoft Visual Basic 5.0 Learning Edition
 * Microsoft Visual Basic 6.0 Learning Edition
 * Microsoft Visual Basic 5.0 Professional Edition
 * Microsoft Visual Basic 6.0 Professional Edition
 * Microsoft Visual Basic 5.0 Enterprise Edition
 * Microsoft Visual Basic 6.0 Enterprise Edition

-



This article was previously published under Q186897



SYMPTOMS
When you run a setup program that was created using the Application Setup Wizard, you receive the following error message:

Failure writing to the system registry. The registry may be corrupt, or

you may not have the required permissions to write to the registry.



CAUSE
As the error message indicates, the problem may be due to a corrupt registry or incorrect permissions to write to the registry. In addition, the problem occurs on computers running Windows 95 when the Setup program tries to add an entry to a registry key and the key will exceed 64K in size as a result. Registry keys are limited to 64K in Windows 95.



RESOLUTION
When the problem occurs on a Windows 95 computer, it usually happens when Setup tries to add entries to the following registry key: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\SharedDLLs To determine whether the SharedDLLs key is approaching the 64K limit, follow these steps to export the key to the Desktop and look at the size of the exported file:
 * 1) Click the Start button, and then click Run.
 * 2) In the Open box, type "regedit" (without the quotation marks), and then click OK.
 * 3) On the Edit menu, click Find. In the Find What box, type "SharedDLLs" (without the quotation marks). Under Look At, select only the Keys check box, and then click Find Next.
 * 4) On the Registry menu, click Export Registry File. In the Save In list, click Desktop. In the File Name box, type "MySharedDLLs" (without the quotation marks), and then click Save.

This saves a copy of the SharedDLLs registry key to a file called MySharedDLLs.reg on the Desktop.
 * 1) On the Desktop, right-click MySharedDLLs.reg, and then click Properties on the shortcut menu. Note the size of the file. If it is approximately 64K in size, the "Failure writing to the system registry" error message is being caused by a limitation of Windows 95.

To work around the 64K limit, open the MySharedDLLs.reg file you created in step 4 in Notepad or Wordpad. Notice which programs have entries in the SharedDLLs key. If you notice file names from programs that you are no longer using, you may want to remove (uninstall) these programs to free up space in the registry key. If you have entries for files that no longer exist on the hard drive, you can remove the entries directly.

If you determine that the error message is not being caused by the 64K registry key limit, try the following:
 * In Windows NT or 2000, try running Setup while logged on the computer as a member of the Administrators group to determine whether there is a problem with permissions.


 * Restore the registry file from a backup. For additional information, please see the "Restoring the Registry" Help topic in Regedit.exe or the "Restoring a Registry Key" Help topic in Regedt32.exe.

In addition, there is now a utility that can help you clean up the SharedDLLs key in the registry. Please see the following Microsoft Knowledge Base article for more information:

217165 FILE: ShareDLL.exe File Checks the Size of the SharedDLLs Regist

Additional query words: capacity limitation

Keywords: kbsetup kbprb kbdsstools KB186897

-

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

© Microsoft Corporation. All rights reserved.