REAGENTC.EXE: Operation failed: 2

When you attempt to enable Windows RE by running the reagentc /enable command, the following error may be shown:

REAGENTC.EXE: Operation failed: 2

REAGENTC.EXE: An error has occurred.

or

REAGENTC.EXE: Unable to update Boot Configuration Data.

The ReAgent.log may record the following error:

Info                         [ReAgentc.exe] Creating BCD entry
Error                        [ReAgentc.exe] open store failed: 0xc000000f
Info                         [ReAgentc.exe] Failed to create BCD recovery entry 2
Info                         [ReAgentc.exe] BCD could not be set, Copying Winre.wim from  to staging location
Info                         [ReAgentc.exe] Moving \\?\GLOBALROOT\device\harddisk0\partition3\Recovery\Temporary\Winre.wim to C:\WINDOWS\system32\Recovery\\winre.wim
Info                         [ReAgentc.exe] SetWinRESettings return with error code 0x2
Error                        [ReAgentc.exe] failed to set WinRE settings, error:0x2
Info                         [ReAgentc.exe] Exit WinReInstall return value: 0, last error: 0x2
Error                        [ReAgentc.exe] failed to install winre: : 0x2
Info                         [ReAgentc.exe] ------------------------------------------------------
Info                         [ReAgentc.exe] -----Exiting command line: reagentc  /enable, Error: 2-----
Info                         [ReAgentc.exe] ------------------------------------------------------
Warning                      [ReAgentc.exe] winreGetOSGuidOrDefault GetCurrentOsGuid returned 0x3bc3
Warning                      [ReAgentc.exe]  (WinRE)WinRECheckGuid() winreGetOSGuidOrDefault failed

Error 0xc000000f means STATUS_NO_SUCH_FILE (File not found), equivalent to the error code 2 (0x80070002).
Error 0x3bc3 (0x80073bc3) means it’s an EFI system partition issue.

Also, when running the BCDEDIT command, the following error may occur:

The boot configuration data store could not be opened.
The system cannot find the file specified.

Cause

The above error occurs due to one of the following reasons:

  1. The EFI partition has a wrong identifier.
  2. The Boot Configuration Database (BCD) or the EFI system partition is inaccessible. Rebuilding the BCD or the EFI partition should resolve the issue.
  3. This problem can also happen after you convert the disk from MBR to GPT using Mbr2GPT. In that case, you only need to create the EFI boot partition.

Resolution

To resolve the error “REAGENTC.EXE: Operation failed: 2“, follow the steps below:

Case 1: EFI partition has a wrong ID

In this case, please fix the EFI system partition’s identifier. See How to Fix the EFI Boot Partition’s ID Using DiskPart.




Case 2: The BCD or EFI partition is inaccessible

Rebuild the EFI system partition. It can be done by formatting the EFI system partition and regenerating the boot files and BCD using the bcdboot command.

For more information, please see How to Rebuild the EFI Boot Partition, BCD and Boot Files.


Case 3: No EFI partition exists

If you have converted the disk from MBR to GPT and forgot to change the boot mode in BIOS/UEFI, your system may have been booting in legacy mode. This happens due to the CSM setting.

If the EFI boot partition is missing, create it using the diskpart command-line tool. For more information on creating the EFI boot partition, see the “Resolution” part in this article (ignore the title). The article has instructions for creating a new EFI system partition using the command-line.

Once done, please enter the UEFI settings and turn off CSM support and Legacy boot. Enable UEFI-only mode or a similar option. This prevents the system from booting into legacy mode.


One small request: If you liked this post, please share this?

One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:
  • Pin it!
  • Share it to your favorite blog + Facebook, Reddit
  • Tweet it!
So thank you so much for your support. It won't take more than 10 seconds of your time. The share buttons are right below. :)

Ramesh Srinivasan is passionate about Microsoft technologies and he has been a consecutive ten-time recipient of the Microsoft Most Valuable Professional award in the Windows Shell/Desktop Experience category, from 2003 to 2012. He loves to troubleshoot and write about Windows. Ramesh founded Winhelponline.com in 2005.

Leave a Comment