REAGENTC.EXE: Operation failed: 2

Anonymous
2023-11-18T03:49:07+00:00

I switched my disk from being mbr to gpt using mbr2gpt. To get this to work I had to disable reagentc using cmd and delete the recovery partition after I did this, the conversion worked also having the recovery partition back but when I went to re-enable reagentc it gave me this error:

C:\WINDOWS\system32>reagentc /enable

REAGENTC.EXE: Operation failed: 2

REAGENTC.EXE: An error has occurred.

Any help would be appreciated.

Windows for home | Windows 10 | Windows update

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
Answer accepted by question author
Ramesh 182K Reputation points Volunteer Moderator
2023-11-18T04:21:15+00:00

In the diskpart environment, run these commands:

  • select vol 3 (where volume 3 is your 526 MB Recovery partition.)
  • set id=ebd0a0a2-b9e5-4433-87c0-68b6b72699c7
  • gpt attributes=0x0000000000000000
  • assign letter=K
  • exit
  • md K:\Recovery\WindowsRE
  • cd /d K:\Recovery\WindowsRE
  • del c:\windows\system32\recovery\reagent.xml /a
  • reagentc /disable
  • xcopy /h C:\Windows\System32\Recovery\winre.wim
  • reagentc /setreimage /path K:\Recovery\WindowsRE /target C:\Windows

Please post the output of each command. If a command fails, please don't continue further.

Was this answer helpful?

6 people found this answer helpful.
0 comments No comments
Answer accepted by question author
Ramesh 182K Reputation points Volunteer Moderator
2023-11-18T07:21:33+00:00

Type:

  • select vol 2 'where #2 is your EFI partition 100 MB FAT32
  • assign letter=Y
  • format quick fs=fat32 label=EFI
  • set id=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
  • exit
  • bcdboot C:\Windows /s Y: /f UEFI

Was this answer helpful?

4 people found this answer helpful.
0 comments No comments
Answer accepted by question author
Ramesh 182K Reputation points Volunteer Moderator
2023-11-18T07:35:01+00:00

Your system may have been booting in legacy mode (ignoring the EFI boot partition) and that may happen due to CSM setting.

Please enter the UEFI settings and disable CSM support and Legacy boot. Enable UEFI only mode or similar option. This prevents the system from booting into legacy mode.

Once done, boot into Windows and update us on the status.

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments
Answer accepted by question author
Ramesh 182K Reputation points Volunteer Moderator
2023-11-18T06:44:15+00:00

There you go. I think the BCD needs to be rebuilt.

Please create a USB setup disk using the Media Creation Tool. See Create installation media for Windows.

Boot the system from the setup disk.

On the Windows setup page, click Next.

Click "Repair your computer".

In WinRE, click Troubleshoot → Advanced Options → Command Prompt.

In WinRE Command Prompt, run:

  • diskpart
  • list vol

Please take a photo of the output screen and post it here.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments
Answer accepted by question author
Ramesh 182K Reputation points Volunteer Moderator
2023-11-18T04:45:21+00:00

Ah! The volume numbers have changed suddenly. We've assigned the ID and attributes to a wrong volume.

Let's fix the EFI partition now.

Run:

  • sel vol 3 (where #3 is your 100 MB FAT32 partition)
  • set id=c12a7328-f81f-11d2-ba4b-00a0c93ec93b
  • gpt attributes=0X8000000000000000
  • sel vol K (where K is your 526 MB Recovery partition)
  • remove
  • set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
  • gpt attributes=0X8000000000000001
  • exit
  • reagentc /enable
  • reagentc /info

Please post the outputs.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments
Answer accepted by question author
Ramesh 182K Reputation points Volunteer Moderator
2023-11-18T04:29:45+00:00

Now, run:

  • diskpart
  • select vol 3
  • remove
  • set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac
  • gpt attributes=0X8000000000000001
  • exit
  • reagentc /enable
  • reagentc /info

Please post the outputs.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments
Answer accepted by question author
Ramesh 182K Reputation points Volunteer Moderator
2023-11-18T03:53:46+00:00

Many preliminary steps need to be performed before you can use the Reagentc.exe command.

  1. Open Disk Management and maximize it. Post a screenshot.
  2. From a Command Prompt window, run:
  • dir C:\Windows\System32\Recovery /a
  • diskpart
  • list disk
  • list vol

Post the output here.

Was this answer helpful?

1 person found this answer helpful.
0 comments No comments

38 additional answers

Sort by: Oldest
  1. Anonymous
    2023-11-18T08:01:43+00:00

    You are welcome. That is great to hear. That was great work to get you a new EFI on Ramesh & your parts!

    (1) But still I think the Recovery partition needs to be activated. I don't think BCDBoot does it. What does ReagentC show...?...

    ReagentC /Info

    ReagentC /Disable

    ReagentC /Enable

    ReagentC /Info

    If it isn't enabled, show the ReAgent.log for that.

    Now I see you did enable it. But is its location harddisk0\partition3? Also, Ramesh's test is definitive.

    (2) Why does the 465 MB partition have no letter? If you are not using it, it should be deleted so that the unallocated space on both sides of it will consolidate with it. Then, create it again & give it a letter. But even then it will be too small for much usefulness.

    Was this answer helpful?

    0 comments No comments