ERROR_KEY_HAS_CHILDREN - 1020 (0x3FC)
Cannot create a symbolic link in a registry key that already has subkeys or values.
Updated: Feb 21, 2026
Technical Background
The ERROR_KEY_HAS_CHILDREN error, with the numeric code 1020 and hex code 0x3FC, indicates that an attempt was made to create a symbolic link in a Windows registry key that already contains subkeys or values. This error is specific to operations involving the Windows Registry API.
Error Details
Meaning as Return Code
This error is returned when attempting to perform an operation on a registry key that has existing subkeys or values, and such an operation would violate the system's constraints for symbolic links in the registry.
Context Dependency
The context of this error depends on the specific Windows API function being used. For example, the RegCreateKeyEx function can return this error if it is called to create a symbolic link within a key that already contains subkeys or values.
Common Causes
- Invalid Operation Context: Attempting to create a symbolic link in a registry key that has existing subkeys or values.
- Unsupported Operations: The operation being attempted is not supported when the specified registry key already contains data.
Real-World Context
This error typically occurs during attempts to modify the Windows Registry, particularly when using functions like RegCreateKeyEx or RegSetValueEx. It highlights a limitation in how symbolic links can be created within the registry structure.
Is This Error Critical?
The criticality of this error depends on the specific operation being performed. If the operation is not essential to the application's functionality, it may be possible to work around the issue by modifying the operation context or using alternative methods.
How to Diagnose
Reviewing Operation Context
Ensure that the registry key in question does not already contain subkeys or values before attempting to create a symbolic link. Use tools like regedit to inspect the key structure.
Validating Parameters
Check the parameters passed to the Windows API function, ensuring they are correct and appropriate for the operation being performed.
Confirming Object Types
Verify that the object types (keys or values) in the registry key match the expected type for the symbolic link creation operation.
How to Resolve
- Correct Parameter Usage: Ensure that all parameters passed to the Windows API function are correct and appropriate for the operation being performed. Specifically, ensure that the key does not contain subkeys or values before attempting to create a symbolic link.
- Adjust Operation Context: If possible, adjust the operation context to avoid creating a symbolic link in a key with existing data. Consider using alternative methods to achieve the desired functionality.
- Restore Data: If the issue is due to corrupted data, restore the registry key from a backup or use tools like
regeditto manually correct the key structure.
Developer Notes
When working with the Windows Registry and symbolic links, it is crucial to understand the limitations imposed by the system. Always validate the state of the registry key before performing operations that could be affected by its contents.
Related Errors
- ERROR_FILE_NOT_FOUND (2): Indicates a file or directory not found in the specified path.
- ERROR_PATH_NOT_FOUND (3): Indicates a path does not exist.
- ERROR_INVALID_PARAMETER (87): Indicates an invalid parameter was passed to a function.
FAQ
Q: Can this error be ignored?
A: It depends on the specific operation. If the operation is not critical, it may be possible to work around the issue. Otherwise, address the underlying problem by ensuring the key does not contain subkeys or values before attempting to create a symbolic link.
Q: How can I prevent this error from occurring?
A: Ensure that you do not attempt to create a symbolic link in a registry key that already contains subkeys or values. Validate the state of the key before performing such operations.
Summary
The ERROR_KEY_HAS_CHILDREN error (1020) indicates an attempt to create a symbolic link in a Windows Registry key that has existing subkeys or values, which is not supported by the system. This error highlights limitations in how symbolic links can be created within the registry structure and requires careful validation of the operation context before attempting such operations.