mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2026-02-17 07:56:24 +00:00
Added full GUI for Win11Debloat + much more (#432)
* Added a full GUI for Win11Debloat * Updated App Selection UI to use WPF framework * Removed deprecated parameters, see https://github.com/Raphire/Win11Debloat/discussions/435 * Replaced Appslist.txt with Apps.json * Added Features.json * Add option to disable the 'Drag Tray' (#433) * Add option to disable bloat in Brave browser (#408) * Add error logging to run.bat (#437) --------- Co-authored-by: Sashank <hello@sashank.wiki> Co-authored-by: Horizon <lvblue0022@gmail.com>
This commit is contained in:
41
Run.bat
41
Run.bat
@@ -1,14 +1,45 @@
|
||||
@echo off
|
||||
setlocal EnableDelayedExpansion
|
||||
|
||||
:: Set Windows Terminal installation paths. (Default and Scoop installation)
|
||||
set "wtDefaultPath=%LOCALAPPDATA%\Microsoft\WindowsApps\wt.exe"
|
||||
set "wtScoopPath=%USERPROFILE%\scoop\apps\windows-terminal\current\wt.exe"
|
||||
set "logFile=%~dp0Win11Debloat.log"
|
||||
|
||||
:: Launch the script in Windows Terminal if installed, otherwise use default PowerShell.
|
||||
:: Determine which terminal exists
|
||||
if exist "%wtDefaultPath%" (
|
||||
PowerShell -Command "Start-Process -FilePath '%wtDefaultPath%' -ArgumentList 'PowerShell -NoProfile -ExecutionPolicy Bypass -File ""%~dp0Win11Debloat.ps1""' -Verb RunAs"
|
||||
set "wtPath=%wtDefaultPath%"
|
||||
) else if exist "%wtScoopPath%" (
|
||||
PowerShell -Command "Start-Process -FilePath '%wtScoopPath%' -ArgumentList 'PowerShell -NoProfile -ExecutionPolicy Bypass -File ""%~dp0Win11Debloat.ps1""' -Verb RunAs"
|
||||
set "wtPath=%wtScoopPath%"
|
||||
) else (
|
||||
echo Windows Terminal not found, using default PowerShell...
|
||||
PowerShell -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%~dp0Win11Debloat.ps1""' -Verb RunAs}"
|
||||
echo Windows Terminal not found. Using default PowerShell instead.
|
||||
set "wtPath="
|
||||
)
|
||||
|
||||
:: Launch script
|
||||
if defined wtPath (
|
||||
call :Log Launching Win11Debloat.ps1 with Windows Terminal...
|
||||
PowerShell -Command "Start-Process -FilePath '%wtPath%' -ArgumentList 'PowerShell -NoProfile -ExecutionPolicy Bypass -File ""%~dp0Win11Debloat.ps1""' -Verb RunAs" >> "%logFile%" || call :Error "PowerShell command failed"
|
||||
call :Log Script execution passed successfully to Win11Debloat.ps1
|
||||
) else (
|
||||
echo Windows Terminal not found. Using default PowerShell instead...
|
||||
call :Log Windows Terminal not found. Using default PowerShell to launch Win11Debloat.ps1...
|
||||
PowerShell -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%~dp0Win11Debloat.ps1""' -Verb RunAs}" >> "%logFile%" || call :Error "PowerShell command failed"
|
||||
call :Log Script execution passed successfully to Win11Debloat.ps1
|
||||
)
|
||||
|
||||
echo.
|
||||
echo If you need further assistance, please open an issue at:
|
||||
echo https://github.com/Raphire/Win11Debloat/issues
|
||||
goto :EOF
|
||||
|
||||
:: Logging Function
|
||||
:Log
|
||||
echo %* >> "%logFile%"
|
||||
goto :EOF
|
||||
:: Error Handler
|
||||
:Error
|
||||
echo ERROR: %*
|
||||
echo Logged in %logFile%
|
||||
pause
|
||||
goto :EOF
|
||||
|
||||
Reference in New Issue
Block a user