mirror of
https://github.com/ZenDeuo/WinRepair.git
synced 2026-06-22 01:40:59 +01:00
28 lines
1.1 KiB
Batchfile
28 lines
1.1 KiB
Batchfile
@echo off
|
|
title WinRepair Launcher
|
|
:: ═══════════════════════════════════════════════════════════════
|
|
:: WinRepair Launcher
|
|
:: Handles UAC elevation + bypasses execution policy
|
|
:: ═══════════════════════════════════════════════════════════════
|
|
|
|
:: Check for admin rights
|
|
net session >nul 2>&1
|
|
if %errorlevel% neq 0 (
|
|
echo Requesting Administrator privileges...
|
|
powershell -NoProfile -Command "Start-Process cmd.exe -ArgumentList '/c \"\"%~f0\"\"' -Verb RunAs"
|
|
exit /b
|
|
)
|
|
|
|
:: We are admin — change to script directory and run
|
|
pushd "%~dp0"
|
|
echo Starting WinRepair...
|
|
powershell.exe -NoProfile -ExecutionPolicy Bypass -File ".\WinRepair.ps1"
|
|
|
|
:: If PowerShell exits with an error, show it
|
|
if %errorlevel% neq 0 (
|
|
echo.
|
|
echo ERROR: WinRepair exited with error code %errorlevel%
|
|
echo Check WinRepair_Error.log for details.
|
|
pause
|
|
)
|
|
popd
|