mirror of
https://github.com/Raphire/Win11Debloat.git
synced 2025-11-17 02:56:17 +00:00
Support launching script through Windows Terminal if installed (#225)
This commit is contained in:
15
Run.bat
15
Run.bat
@@ -1 +1,14 @@
|
||||
PowerShell -ExecutionPolicy Bypass -Command "& {Start-Process PowerShell -ArgumentList '-NoProfile -ExecutionPolicy Bypass -File ""%~dp0Win11Debloat.ps1""' -Verb RunAs}"
|
||||
@echo off
|
||||
:: 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"
|
||||
|
||||
:: Launch the script in Windows Terminal if installed, otherwise use default PowerShell.
|
||||
if exist "%wtDefaultPath%" (
|
||||
PowerShell -Command "Start-Process -FilePath '%wtDefaultPath%' -ArgumentList 'PowerShell -NoProfile -ExecutionPolicy Bypass -File \"\"%~dp0Win11Debloat.ps1\"\"' -Verb RunAs"
|
||||
) else if exist "%wtScoopPath%" (
|
||||
PowerShell -Command "Start-Process -FilePath '%wtScoopPath%' -ArgumentList 'PowerShell -NoProfile -ExecutionPolicy Bypass -File \"\"%~dp0Win11Debloat.ps1\"\"' -Verb RunAs"
|
||||
) 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}"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user