Cannot Import Registry File: Not All Data Was Successfully Written to the Registry


When Registry Editor says not all data was successfully written to the registry, it means an import of a .reg file did not finish cleanly. Some entries may have been written, while others may not have been. The message does not say which is which.
Last reviewed: November 25, 2026. The steps below were compared with Microsoft documentation on backing up and importing the registry, and none of them was run on a real PC; the picture at the top is an illustration.
Quick answer
Quick answer
- What it means: the import wrote some entries and could not write others, or none. Windows does not say which.
- Most common causes: the import lacks administrator rights, a key is protected or owned by TrustedInstaller, a running program or service holds the key open, or the file was made for another Windows version or bit layout.
- Safe first steps: close the program the file is for, confirm the file came from a trusted source, then make a restore point and a registry export of the keys the file touches.
- Then: check the message against the symptom table, and ask the file's maker for a corrected file if the file is the cause.
- Stop when: the fix would mean taking ownership of system keys, turning off Windows Security or tamper protection, or using a tool that forces writes.
In this guide
What the two messages mean: not all data was successfully written to the registry
There are two messages people see most often when they import a .reg file. They are worded roughly as "Cannot import file.reg: Error accessing the registry" and "Not all data in file.reg was successfully written to the registry. Some keys are open by the system or other processes, or you do not have permission to edit them." The exact wording can vary between Windows versions.
The first message usually means the import could not open or write to the registry at all, or could not read the file in the form it expected. The second message is more specific. Registry Editor applied some of the file and could not apply the rest. The import is not all or nothing, so some keys may hold the new values while others still hold the old ones.
Microsoft's reg import command copies the contents of a file that contains exported registry subkeys, entries and values into the registry of the local computer (Microsoft Learn, reg import). As general guidance, Registry Editor does not show a list of the entries that failed. That is why the safe approach is to find out what the file touches before anything else.
What the error does not mean
This message is not proof that your PC has malware. Windows and security software protect some keys by default, and a harmless file that touches those keys can fail to import. Permissions on a key are a common reason.
It is also not proof that the registry is corrupted. A damaged registry tends to show up as crashes, failed logins, or apps that will not start, and the import message alone does not show that. If you do have those symptoms, read the separate guides on registry problems and their symptoms and on how to fix a corrupted registry before you change anything else.
Common causes
The cause is usually one of the items below. The first two are the easiest to check.
The import is not running with administrator rights
Some keys, especially those under HKEY_LOCAL_MACHINE, can only be changed by an administrator. If Registry Editor was opened as a standard user, the import can fail for part of the file. Microsoft's registry backup guidance notes that Registry Editor can prompt for an administrator password or for confirmation (Microsoft Support, back up and restore the registry). Administrator rights help with some keys, but they do not override every protection. A non-elevated program that writes to some HKLM keys may also have the write quietly redirected to a per-user copy, which is explained in our guide to registry virtualization and VirtualStore.
The key is protected, or owned by TrustedInstaller
Windows protects many system keys so that only the operating system's own components can change them. When a file tries to write to one of these keys, the write can be refused even for an administrator. The usual fix people look for is to take ownership of the key and change its permissions. This guide does not recommend that. The permission explanation is in the separate article on fixing registry permission errors, which explains what the messages mean without asking you to change ownership.
A running program or service has the key open
The wording "some keys are open by the system or other processes" is literal. If the program that owns a key is running, its keys can be locked for writing. Closing the program, or in some cases restarting the PC, lets the import finish. Background services can hold keys open even when no window is visible.
The file was made for another Windows version or another layout
Some .reg files are written for a specific version of Windows or for a specific bit layout. A 32-bit application on a 64-bit Windows install stores some of its settings in a separate part of the registry, and a file made for the other layout can write to the wrong place or fail. The reg import command has /reg:32 and /reg:64 options for this reason (Microsoft Learn, reg import). General advice is to get a file that matches your Windows version and your program's bit version. For the layouts, see Wow6432Node and 32-bit versus 64-bit registry views.
The .reg file is damaged or wrongly encoded
A .reg file has a strict text format. A missing bracket, a broken line, or a wrong text encoding can make Registry Editor refuse part of the file. Saving a .reg file from a word processor, or copying it through a chat app that changes line endings, is a common way this happens. Get a fresh copy from its source rather than repairing it by hand.
Windows Security or security software blocked the file
Some security software blocks changes to startup and system settings, and a block can look like a permission error. Check the security app's history or quarantine list for a block on the file, and do not turn the protection off to get past it. If you are unsure about the file itself, read whether a .reg file is safe to run before doing anything else.
Symptom table: message, likely cause and safe next step
Use this table to match what you see with a likely cause and a first step. The first step in every row is safe, and none of the rows calls for editing keys by hand.
| Message | Likely cause | Safe next step |
|---|---|---|
| Cannot import file.reg: Error accessing the registry | Not enough rights, or the file could not be read properly | Close the program the file is for, make a registry export and a restore point, then ask the maker for a corrected file |
| Not all data was successfully written, keys open by the system or other processes | A running program or service holds some keys open | Close the related program fully from the system tray, restart if needed, and check the program before anything else |
| Not all data was successfully written, permission problem | A protected key that Windows or another owner controls | Stop and ask the file's maker, or use the Windows setting the file was meant to change |
| Either message, after a file from an old guide or another PC | The file was made for another Windows version or bit layout | Get a file that matches your Windows version and program bit version from the maker |
| Either message, with odd text or missing brackets in the file | A damaged or wrongly encoded .reg file | Get a fresh copy from the source and do not edit the lines by hand |
| Import stops with a block, or the file disappears | Windows Security or other security software blocked the file | Check the security app's history, keep protection on, and confirm the file's source |
Decision tree
Start at the top and follow one branch at a time. Stop at the first branch that matches.
- Did the file come from a source you trust?
- No: stop. Find out what the file changes before going further.
- Yes: continue.
- Is a program the file changes running right now?
- Yes: close it completely, then continue.
- No: continue.
- Do you have a restore point and a registry export of the keys the file touches?
- No: make them now, using Steps 1 and 2 below. Do not continue without them.
- Yes: continue.
- Does the message name a protected key or a permission problem?
- Yes: stop, and ask the file's maker or use the Windows feature it was meant to change.
- No, and a program was running: check that program's settings and keep the export on hand.
- No, and no program was running: the file may be damaged or built for another layout. Get a fresh copy from the maker.
Before you start
Before you start
Importing a .reg file overwrites the values it names, and a partial import can leave keys in a mixed state. Make a restore point and a registry export of the keys the file touches before you change anything. Do not run a file you cannot identify, and do not use a tool that claims to force registry writes past a block.
Read how to back up the registry before changes first, because it covers exporting a single branch rather than the whole registry. As general guidance, back up the registry before any change. The Microsoft pages listed in Sources cover the export steps. If you want to see what a file does before it reaches your everyday PC, our guide to testing registry changes in Windows Sandbox explains a safer place to try it.
Check what the file touches
You can look at a .reg file without running it. This is a read-only check. Right-click the file, choose Show more options if you see it, then Edit, which opens the file in Notepad. Do not save anything you change while reading it.
You should see plain text. Each section starts with a key path in square brackets, such as a path under HKEY_LOCAL_MACHINE or HKEY_CURRENT_USER, followed by value names and data. Each value also carries a type, such as REG_SZ or REG_DWORD, and our guide to registry value types explained covers the common ones. Note which top-level hives the file touches, and whether it names any program or service.
If the file touches keys you do not recognise, stop, because you cannot tell what it will change. The guide on Windows registry hives, keys and values explains the structure in plain words.
Safe steps to take
Work through these steps in order. Do not skip the first two, because they are what let you undo an attempt.
Step 1: Make a restore point
Create a System Restore point before you change anything. Search the Start menu for create a restore point and follow the prompts for the system drive. Menu names can differ between Windows 11 and Windows 10, so look for the closest match.
You should see: a confirmation that the restore point was created, with its name and date.
If this fails: if restore points are turned off or the option is missing, read the recovery section of this guide before you go on, and make the registry export in Step 2 at minimum.
Step 2: Export the keys the file touches
Open Registry Editor and locate the key or subkey the file names. Microsoft's backup page describes selecting the key, then using File and Export to save a copy. Choose the option for the selected branch rather than the whole registry, so the backup stays small. Save it somewhere outside the file's folder.
You should see: a .reg backup file with the branch name in its title, saved where you can find it again.
If this fails: if the Export option is greyed out, you may not have rights to read the key. Stop here and ask the file's maker, or check the permission guide, before you go on.
Step 3: Close the program the file is for
Close the program from the taskbar and the system tray, and make sure it is not still running in the background. If the program runs as a service, stop it from the Services list or restart the PC. Do not stop services that you do not recognise.
You should see: no window and no tray icon for the program, and no process of the same name in Task Manager.
If this fails: if the program restarts by itself, check its startup settings in its own options. Ask the program's maker if it keeps running after you close it.
Step 4: Get a corrected file if the file is the cause
Ask the file's maker for a version built for your Windows version and your program's bit version. Do not repeat the same import several times. Each failed attempt can leave another partial change, and a second try of a file that failed is not a fix.
You should see: a reply from the maker, or a note on its download page, that names the Windows version and bit layout the file is for.
If this fails: if the maker cannot supply a corrected file, stop. Keep your restore point and your export, and do not use a tool that forces the change through.
Step 5: Check the program and keep your export
Open the program the file was for and check the setting you wanted. If the program now behaves oddly, the partial import may have changed some keys. In that case, use the Undo section of this guide to restore from your own export.
You should see: the program running normally, with the setting either as you expected or as it was before the attempt.
If this fails: if the program misbehaves and your export does not help, stop and read the System Restore guide in the recovery section before you try anything else.
Try Safe Mode only if the maker says so
Some guides suggest starting Windows in Safe Mode before an import. Use this only if the file's maker says so for that specific file. Safe Mode runs fewer programs, but it does not get past permission rules, and it is not a general fix. The guide on how to boot into Safe Mode in Windows explains the start-up options.
When to stop
Some situations are not for home troubleshooting. Stop and do not try the workarounds below.
- The fix would require you to take ownership of a system key or change its permissions by hand.
- The step would turn off Windows Security, real-time protection, or tamper protection.
- A tool offers to force registry writes past a block, or promises to repair the registry in one click.
- The file asks you to disable a Windows feature that is managed by your administrator.
Instead, ask the file's maker for a version that works on your system, or use the Windows feature the file was meant to change. As general guidance, many settings in Windows 11 can be changed in the Settings app, and on Windows 11 Pro and higher some policies are set through Group Policy. The guide on Group Policy compared with registry changes explains when each one is the right tool. If a .reg file was meant to change a setting that your organization manages, see settings managed by your organization. If the registry editing tools themselves are blocked, the guide on registry editing disabled by an administrator explains what that means. If a registry cleaner has reported the file's keys as errors, read what registry cleaner errors mean before acting.
Undo and recovery
If an import went wrong, the safest route back is usually System Restore to the restore point you made before the attempt. Microsoft's System Restore page says that selecting a restore point reverts system files, registry settings and installed programs to the state they were in when the point was created (Microsoft Support, System Restore). As general guidance, it does not change your personal files. The step-by-step guide is in the article on how to use System Restore. For more detail on registry keys, see whether System Restore restores the registry.
If you only need to reverse the keys you exported, you can import your own backup file back into Registry Editor. Use only the backup you made yourself, from the same PC, before the change. That is the only import this guide covers. It reverses your own export and does not retry the original file.
Note
A registry export is not a full system backup. It covers only the keys you selected. For a full recovery plan, see the guide on how to back up your Windows PC.
If the PC will not start properly
If the PC will not start properly after the attempt, read the guides on repairing Windows system files with SFC and DISM and on undoing registry cleaner changes. Both start with a backup. For a repair that keeps your files, see the guide on repairing Windows 11 without losing files.
How we checked this guide
We compared each step with Microsoft documentation. We did not run these steps on a real PC, and the picture at the top is an illustration. Where Microsoft does not name a menu item, we wrote general guidance, and menu names can differ between Windows versions.
Windows 10 note
Support for Windows 10 ended on October 14, 2025, so Windows 10 PCs no longer receive free software updates, security fixes or technical assistance from Microsoft. Consumer Extended Security Updates (ESU) coverage runs through October 12, 2027. Menus and labels can differ on Windows 10, so if a name in this guide does not match your screen, look for the closest equivalent and ask before guessing.
For more help with Windows troubleshooting, browse the PC repair guides, or the malware and registry guide if you suspect a security problem. The Repair Assistant tool can also help you narrow down the symptom.
Frequently asked questions
Understanding the message
Does "not all data was successfully written to the registry" mean my registry is broken?
No. The message only means the import could not write every entry in the file. It does not show that the registry is damaged. Check the cause first, such as a running program or a protected key.
Were the entries that did import now active?
Some may be. The import is not all or nothing, so some keys can have the new values while others keep the old ones. That is why a restore point and a registry export come before anything else.
Can a file that causes this message be malware?
The message alone does not show that. Permission problems and locked keys cause it on harmless files too. If you suspect the file itself, check its source and use the malware guide before running anything else.
Why does the message mention keys open by other processes?
A running program or service can keep some keys open, which blocks writes to them. Closing the program fully, and restarting the PC if it runs as a service, is the usual way to clear that block.
Fixing it safely
Should I take ownership of the key so the import works?
No, this guide does not recommend it. Changing ownership of a system key is a permission change that can break Windows and is hard to undo. The permission article explains what the messages mean without that step.
Does running as administrator fix this message?
Not by itself. Administrator rights matter for some keys, but protected keys can still refuse writes. If the message names a protected key, stop and ask the file's maker.
Can I turn off Windows Security to get the file in?
No. Turning off Windows Security or tamper protection to force a change removes protection that you may need later. Keep protection on and check its history for a block on the file.
What if the file came from an old guide?
Ask for a file built for your Windows version and bit layout. An old file can write to the wrong place or fail, and the maker is the best source for a corrected version.
Sources
- How to back up and restore the registry in Windows | Microsoft Support
- Windows registry for advanced users | Microsoft Learn
- reg import | Microsoft Learn
- reg commands | Microsoft Learn
- System Restore | Microsoft Support
- Windows 10 support has ended on October 14, 2025 | Microsoft Support
- Windows 10 Extended Security Updates | Microsoft Windows