PowerShell-based system recovery utility designed to repair Windows installations after unexpected shutdowns, power outages, or file system corruption
Features β’ Installation β’ Usage β’ Workflow β’ Logs β’ Safety
This project is intended as a technical portfolio piece, showcasing system-level troubleshooting, defensive scripting, and operational safety practices.
SysRevive - Windows System Repair Script is an automated PowerShell solution that combines multiple Windows built-in repair utilities (SFC, DISM) in a structured, automated workflow with comprehensive error checking and progress reporting. Particularly useful after:
- π Power outages or unexpected shutdowns
- π₯ System crashes or blue screens (BSOD)
- ποΈ File system corruption
- π Failed Windows updates
β οΈ System instability issues
- Full Spanish and English interface - select your preferred language at startup
- Translations for all messages and prompts
- Administrator safety checks - automatic privilege verification
- Automatic system restore point creation before repairs begin
- Disk space validation - minimum 10GB recommended
- Process duration warning with detailed time estimates
- Phase 1: System File Checker (SFC) initial scan
- Phase 2: DISM image health verification and repair
- Phase 3: Final SFC verification
- Phase 4: System Cleanup
- Color-coded status messages (Info, Success, Warning, Error)
- Real-time progress indicators with timestamps
- Visual separators and formatted output
- Execution time tracking per phase
- Exit code tracking for each operation
- Duration tracking for all phases
- Clear logging references for post-analysis
- Final summary with recommendations
The script follows a defensive, layered repair strategy:
- β Administrator privileges verification
- β Available disk space validation (minimum 10GB)
- β System restore point creation
- β User confirmation after duration warning
sfc /scannow- Initial integrity scan and repair of protected system files
- Duration: 05-30 minutes
DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /RestoreHealth- Image health check
- Component store scan
- Online image restoration
- Duration: 10-40 minutes
sfc /scannow- Second SFC run to validate system consistency
- Ensures all repairs were successful
- Duration: 05-30 minutes
DISM /Online /Cleanup-Image /StartComponentCleanup- Component cleanup to remove superseded files
- Frees up disk space
- Duration: 01-10 minutes
Total Estimated Time: 20 minutes to 2 hours (Depends on disk performance)
| Requirement | Details |
|---|---|
| Operating System | Windows 10 / Windows 11 |
| PowerShell Version | 5.1 or later |
| Privileges | Administrator rights required |
| Free Disk Space | Minimum 10GB on system drive (C:) |
| Internet Connection | Recommended for DISM operations |
| Time Required | 20 minutes to 2 hours |
-
Download both files from this repository:
windows_repair_launcher.bat repair_windows.ps1 -
Place both files in the same folder (e.g.,
C:\SystemRepair\)
git clone https://github.com/RCGAProds/SysRevive.git
cd SysRevive- Right-click on
windows_repair_launcher.bat - Select "Run as administrator"
- Follow the on-screen prompts
- Open PowerShell as Administrator
- Navigate to the script directory
- Execute:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass
.\repair_windows.ps1βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SELECCION DE IDIOMA / LANGUAGE SELECTION β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
1. EspaΓ±ol
2. English
Select language / Seleccione idioma (1-2): _
The script will display:
- Estimated duration for each phase
- Total estimated time (20 min - 2 hours)
- Important recommendations before starting
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β IMPORTANT INFORMATION β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ESTIMATED PROCESS DURATION
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
The repair process consists of 4 phases:
β’ Phase 1 (Initial SFC): 05-30 minutes
β’ Phase 2 (DISM): 10-40 minutes
β’ Phase 3 (Final SFC): 05-30 minutes
β’ Phase 4 (Cleanup): 01-10 minutes
TOTAL ESTIMATED TIME: 20 minutes to 2 hours (Depends on disk performance)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
IMPORTANT BEFORE CONTINUING:
β Make sure your computer is plugged into power
β Do not turn off or restart the computer during the process
β Close all open applications
β Save all your work before continuing
β The computer may become slow during the process
The script will automatically execute all phases with real-time status updates:
[14:32:15] β Creating system restore point...
[14:32:18] β Restore point created successfully
[14:32:19] βΉ Free space on drive C: 45.23 GB
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
PHASE 1: System File Checker (SFC)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
[14:32:20] β Running SFC /scannow...
[14:32:20] βΉ This process may take 05-30 minutes. Please wait...
After execution, review the following logs for detailed diagnostics and incident analysis:
The tool generates two types of logs for incident analysis:
- Launcher/Script Log: Found in the script folder as
repair_powershell_YYYYMMDD_HHMMSS.log. This tracks the script's logic and exit codes. - Native Windows Logs:
- SFC:
C:\Windows\Logs\CBS\CBS.log - DISM:
C:\Windows\Logs\DISM\dism.log
- SFC:
C:\Windows\Logs\CBS\CBS.log
Contents: System File Checker operations, file replacements, integrity violations
C:\Windows\Logs\DISM\dism.log
Contents: Image servicing operations, component store repairs, Windows Update downloads
Extract SFC-specific information:
findstr /c:"[SR]" C:\Windows\Logs\CBS\CBS.log > C:\SFC-Results.txtCheck DISM errors and warnings:
Get-Content C:\Windows\Logs\DISM\dism.log | Select-String "Error|Warning" -Context 2,2These logs are essential for root cause investigation and understanding what was repaired.
Solution:
1. Right-click windows_repair_launcher.bat
2. Select "Run as administrator"
3. Click "Yes" on UAC prompt
Solution: The launcher automatically bypasses execution policy. For manual execution:
Set-ExecutionPolicy -Scope Process -ExecutionPolicy BypassSolution:
- Free up at least 10GB on C: drive
- Empty Recycle Bin
- Run Disk Cleanup (cleanmgr.exe)
- Remove temporary files
Solution:
- Ensure System Protection is enabled for C: drive
- Check sufficient privileges
- Script will continue even if restore point creation fails
Explanation:
- This is why DISM runs before final SFC verification
- DISM repairs the Windows image source files
- The final SFC pass should then succeed
- Review
CBS.logfor specific file details
A: Yes. This script only uses official Windows built-in tools (SFC and DISM). It creates a restore point before starting and doesn't modify the registry or install third-party software.
A: No. These tools only repair system files, not user data. Your documents, photos, and personal files are not affected.
A: Not recommended. The computer will be slow, and interrupting the process could cause issues. Best to let it run unattended.
A: DISM may download files from Windows Update if local files are corrupted. Internet connection is recommended but not always required.
A: Some phases take a very long time (up to 40 minutes for DISM). Check the timestamp. If no progress after 60+ minutes, the process may be frozen.
A:
- SFC logs:
C:\Windows\Logs\CBS\CBS.log - DISM logs:
C:\Windows\Logs\DISM\dism.log
A: Yes, highly recommended. The script will prompt for automatic restart.
This tool is intended for:
- βοΈ Educational purposes - learning system repair techniques
- βοΈ Personal system recovery - fixing your own computer
- βοΈ Technical demonstrations - showcasing PowerShell skills
- βοΈ Portfolio and skill showcase - professional development
It is not intended for production environments without prior validation, adaptation, and risk assessment.
β οΈ The script performs read/write operations on system components- πΎ A restore point is created whenever possible, but no guarantee is provided
- π Always ensure critical data is backed up before running system repairs
- π‘οΈ Use at your own risk
The author is not responsible for any data loss or system issues that may occur.
Contributions are welcome! This is a portfolio project, but improvements are appreciated.
- π Additional language translations
- π¨ UI/UX improvements
- π Enhanced reporting features
- π Documentation improvements
- Fork the repository
- Create a feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the Creative Commons Attribution-NonCommercial 4.0 International (CC BY-NC 4.0) license.
- βοΈ Share β copy and redistribute the material in any medium or format
- βοΈ Adapt β remix, transform, and build upon the material
- Attribution β You must give appropriate credit to the author, provide a link to the license, and indicate if changes were made
- NonCommercial β You may not use the material for commercial purposes
- β Commercial use is strictly prohibited without explicit permission
- β No enterprise deployment or integration into paid products/services
Full license text available at: https://creativecommons.org/licenses/by-nc/4.0/
See the LICENSE file for full details.
Carlos GarcΓa
IT Support | Junior SOC Analyst
If you are interested in commercial usage or integration, please contact me to discuss a separate licensing agreement.
- Microsoft for SFC and DISM utilities
- PowerShell community for scripting best practices
- All contributors providing feedback and improvements
Made with β€οΈ as a technical portfolio piece
β Star this repository if you found it helpful!
Β© 2026 Carlos GarcΓa