Understanding Why RegSaveKey Fails

Last reviewed: January 15, 1997
Article ID: Q154806
The information in this article applies to:
  • Microsoft Win32 Application Programming Interface included with:

        - Microsoft Windows NT, versions 3.51, 4.00
        - Microsoft Windows 95, version 4.0
    

SUMMARY

The RegSaveKey API can be used to save a registry key and all of its subkeys to a specified file. The API creates the file in the following manner depending upon which operating system it is running on:

   ----------------------------------------------------------------------
   |                  |    WINDOWS 95           |     WINDOWS NT        |
   ----------------------------------------------------------------------
   | File attributes | archive, hidden,         | archive               |
   |                 | read-only, system        |                       |
   ----------------------------------------------------------------------
   | Location of     | Created in the windows   | Created in the        |
   | saved registry  | directory for both local | current directory     |
   | file if no path | and remote keys.         | of the process for a  |
   | is specified.   |                          | local key, and in the |
   |                 |                          | %systemroot%\system32 |
   |                 |                          | for a remote key.     |
   ----------------------------------------------------------------------
   | Error returned  | error code 1016,         | error code 183,       |
   | if file already | ERROR_REGISTRY_IO_FAILED | ERROR_ALREADY_EXISTS  |
   | exists.         |                          |                       |
   ----------------------------------------------------------------------


KBCategory: kbprg kbhowto
KBSubcategory: BseRegistry
Additional reference words: 3.51 4.00 Win95 kbdss




THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: January 15, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.