Skip to content
KitploitKITPLOIT
ToolsExploitsBlog
Log in
Submit
ToolsExploitsBlog
Submit

Hacking, PenTest, and Cybersecurity Tools for Your Security Arsenal!

Kitploit is a directory of hacking, cybersecurity, and pentesting tools. Discover the latest project updates to find vulnerabilities, analyze systems, automate testing, and strengthen your security.

FeedsContactPrivacy© 2026 Kitploit

Tool Directory

Categories

View all categories
Loading categories
WinRE-Fix — PowerShell script to fix WinRE/Recovery partition issues - KB5034441, KB5028997, CVE-2024-20666 Windows Update failures | Kitploit
Tools/GitHubGitHub/tazxtazxedu/winre-fix
General Purpose UtilitiesEncryption/Decryption ToolsVulnerability AnalysisScripting & AutomationConfiguration Auditing
GitHubtazxtazxedu/winre-fix

WinRE-Fix

PowerShell script to fix WinRE/Recovery partition issues - KB5034441, KB5028997, CVE-2024-20666 Windows Update failures

View Repository
13411 months agoNot yet reviewed
Share

WinRE-Fix

Windows PowerShell License: MIT

PowerShell script to safely move/recreate Windows Recovery Environment (WinRE) to a new Recovery partition.

Keywords: WinRE Windows Recovery Recovery Partition reagentc KB5034441 KB5028997 CVE-2024-20666 BitLocker Windows Update Fix Partition Resize GPT UEFI


🎯 What This Script Solves

This script helps fix common Windows Update errors related to WinRE partition:

  • KB5034441 / KB5028997 installation failures
  • "Windows Recovery Environment servicing failed" errors
  • Recovery partition too small for security updates
  • CVE-2024-20666 BitLocker security update issues

⚠️🔴 BACKUP WARNING / YEDEK UYARISI 🔴⚠️

🇹🇷 Türkçe🇬🇧 English
Bu script'i çalıştırmadan önce mutlaka tam sistem yedeği alın! Disk/partition işlemleri geri dönüşü olmayan veri kaybına yol açabilir.Take a full system backup before running this script! Disk/partition operations can cause irreversible data loss.

🇹🇷 Türkçe

Özet

Winre-Fix.ps1 Windows Recovery Environment (WinRE) bileşenini güvenli bir şekilde yeni bir Recovery partition'a taşıyan/yeniden oluşturan bir PowerShell betiğidir.

Gereksinimler

  • Desteklenen İşletim Sistemleri:
    • Windows 10 (1903+)
    • Windows 11 (tüm sürümler)
    • Windows Server 2016 / 2019 / 2022 / 2025
  • Yönetici (Administrator) hakları ile çalıştırma zorunludur
  • PowerShell 5.1 veya PowerShell 7+
  • GPT disk (MBR değil) + UEFI boot modu

⚠️ Önemli Uyarılar

  • Yedek alın! Partition ve disk işlemleri veri kaybına yol açabilir.
  • Önce -WhatIf ile simülasyon çalıştırın.
  • Script sadece Disk 0 üzerinde çalışır.

Parametreler

ParametreAçıklama
-WhatIfGerçek değişiklik yapmadan adımları simüle eder (güvenli test modu)
-ForceOnay istemeden tüm adımları uygular + minimum alan uyarılarını geçer
-VerboseAyrıntılı çıktı/log için verbose modu

Script Akışı

1. PRE-CHECK: Disk 0'da "Unallocated" (boş) alan var mı?
   ├─ Yok → HATA: "No unallocated space found" → Çıkış
   ├─ < 1.2 GB → Uyarı, -Force gerekli
   └─ >= 1.2 GB → OK, devam
        ↓
2. Yedek onayı iste (YES yazılmalı, -Force/-WhatIf ile atlanır)
        ↓
3. Recovery partition'ı bul (GPT Type ile tüm partition'ları tarar)
   ├─ Bulunamadı → HATA → Çıkış
   └─ Bulundu → OK, devam
        ↓
4. Partition doğrulama (boyut < 10 GB olmalı)
   ├─ Çok büyük → HATA: "Too large, might be Windows!" → Çıkış
   └─ OK → devam
        ↓
5. WinRE disable et (reagentc /disable)
        ↓
6. Eski Recovery partition'ı sil
        ↓
7. C: sürücüsünü genişlet (1 GB rezerv bırakır)
        ↓
8. Yeni Recovery partition oluştur + NTFS formatla
        ↓
9. GPT Type + Hidden attribute ayarla (diskpart)
        ↓
10. WinRE enable et (reagentc /enable)
        ↓
   TAMAMLANDI!

Örnek Kullanım

# 1. Simülasyon (güvenli test)
.\Winre-Fix.ps1 -WhatIf -Verbose

# 2. Normal çalıştırma (onay sorar)
.\Winre-Fix.ps1

# 3. Otomatik çalıştırma (onay sormaz)
.\Winre-Fix.ps1 -Force

Log Dosyası

  • Konum: C:\temp\WinRE-Fix-Log.txt

🇬🇧 English

Summary

Winre-Fix.ps1 is a PowerShell script that safely moves/recreates the Windows Recovery Environment (WinRE) to a new Recovery partition.

Requirements

  • Supported Operating Systems:
    • Windows 10 (1903+)
    • Windows 11 (all versions)
    • Windows Server 2016 / 2019 / 2022 / 2025
  • Run as Administrator (required)
  • PowerShell 5.1 or PowerShell 7+
  • GPT disk (not MBR) + UEFI boot mode

⚠️ Important Warnings

  • Back up your data! Disk/partition operations can cause data loss.
  • Run with -WhatIf first to simulate.
  • Script only works on Disk 0.

Parameters

ParameterDescription
-WhatIfSimulate steps without making changes (safe test mode)
-ForceSkip confirmation prompts + override minimum space warnings
-VerboseEnable detailed output/logging

Script Flow

1. PRE-CHECK: Is there "Unallocated" space on Disk 0?
   ├─ None → ERROR: "No unallocated space found" → Exit
   ├─ < 1.2 GB → Warning, requires -Force
   └─ >= 1.2 GB → OK, proceed
        ↓
2. Backup confirmation (must type YES, skipped with -Force/-WhatIf)
        ↓
3. Find Recovery partition (scans all partitions by GPT Type)
   ├─ Not found → ERROR → Exit
   └─ Found → OK, proceed
        ↓
4. Partition validation (size must be < 10 GB)
   ├─ Too large → ERROR: "Might be Windows drive!" → Exit
   └─ OK → proceed
        ↓
5. Disable WinRE (reagentc /disable)
        ↓
6. Delete old Recovery partition
        ↓
7. Extend C: drive (reserves 1 GB)
        ↓
8. Create new Recovery partition + format NTFS
        ↓
9. Set GPT Type + Hidden attribute (diskpart)
        ↓
10. Enable WinRE (reagentc /enable)
        ↓
   COMPLETE!

Usage Examples

# 1. Simulation (safe test)
.\Winre-Fix.ps1 -WhatIf -Verbose

# 2. Normal run (asks for confirmation)
.\Winre-Fix.ps1

# 3. Automatic run (no confirmation)
.\Winre-Fix.ps1 -Force

Log File

  • Location: C:\temp\WinRE-Fix-Log.txt

Safety Features

CheckDescription
🔒 AdministratorScript exits if not run as Administrator
💾 Unallocated SpaceChecks for free disk space before any changes
✅ Backup ConfirmationRequires typing "YES" before proceeding (skipped with -Force)
🔍 GPT Type ScanFinds Recovery partition by scanning all partitions for correct GPT type
📏 Size Sanity CheckRecovery partition must be < 10 GB (prevents deleting Windows!)
📝 Full LoggingAll operations logged to C:\temp\WinRE-Fix-Log.txt
🛡️ Winre.wim CheckVerifies recovery image exists before enabling WinRE

License

MIT License - Use at your own risk.

Author

Created for safe WinRE partition management on Windows systems.

Download Tool

Most Popular

View all →

Discover the most used tools by our community.

  • 1

    OsintHunter

    letox4/osinthunter

    🎯 The ultimate OSINT toolkit: investigation graph, confidence scoring, alias families, map, timeline and reports. 49 modules, 400+ sites, no API keys required.

    790
  • 2

    ghostlock-app

    yukonga/ghostlock-app

    GhostLock One-Tap Execution App (CVE-2026-43499)

    508
  • 3

    ARTEX

    baarai/artex

    LLM multi-agent autonomous penetration testing platform with planner/worker agents, asset and exploration graphs, MITM traffic recording, and vulnerability retesting.

    435
  • 4

    redforge

    cybersecurity91/redforge

    Browser-side red team toolkit with 102 offline tools for recon, payload generation, credential attacks, crypto, encoding and engagement reporting.

    346
  • 5

    CyberStrikeAI

    ed1s0nz/cyberstrikeai

    The system of action for AI-native cybersecurity—where intent becomes governed execution, evidence becomes operational memory, and every operation improves the next.

    263
  • 6

    looking-glass

    anonghosty/looking-glass

    CSIRT platform that ingests Shadowserver reports into MongoDB and replays them as interactive maps, analysis, findings, advisories and executive dashboards.

    260

Explore all tools

Browse our collection of tools

View all tools →