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 181.9K 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 181.9K 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 181.9K 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 181.9K 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 181.9K 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 181.9K 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 181.9K 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: Most helpful
  1. Anonymous
    2023-11-18T04:14:46+00:00

    Directory of C:\WINDOWS\system32\Recovery

    11/17/2023 07:11 PM <DIR> .

    11/17/2023 07:11 PM <DIR> ..

    11/17/2023 05:55 PM 1,079 ReAgent.xml

    12/02/2018 09:47 PM 1,111 ReAgent_Merged.xml1

    01/21/2022 12:59 PM 444,720,451 winre.wim

               3 File(s)    444,722,641 bytes 
    
               2 Dir(s)  56,219,525,120 bytes free 
    

    C:\WINDOWS\system32>diskpart

    Microsoft DiskPart version 10.0.19041.3636

    Copyright (C) Microsoft Corporation.

    On computer: COMPUTER

    DISKPART> list disk

    Disk ### Status Size Free Dyn Gpt


    Disk 0 Online 465 GB 829 MB *

    Disk 1 Online 931 GB 1024 KB *

    Disk 2 Online 1816 GB 0 B

    DISKPART> list vol

    Volume ### Ltr Label Fs Type Size Status Info


    Volume 0 C NTFS Partition 463 GB Healthy Boot

    Volume 1 NTFS Partition 465 MB Healthy System

    Volume 2 FAT32 Partition 100 MB Healthy Hidden

    Volume 3 NTFS Partition 526 MB Healthy Hidden

    Volume 4 D Samsung SSD NTFS Partition 931 GB Healthy

    Volume 5 E Xbox HDD NTFS Partition 1816 GB Healthy

    DISKPART>

    Was this answer helpful?

    0 comments No comments