Fix Run.bat quoting bug (again) breaking on certain paths

This commit is contained in:
Jeffrey 2026-07-07 20:45:45 +02:00
parent a2e3eb2987
commit 80b5452147
No known key found for this signature in database

View File

@ -24,12 +24,12 @@ set "SCRIPT_PATH=%~dp0Win11Debloat.ps1"
:: Launch script
if defined wtPath (
call :Log Launching Win11Debloat.ps1 with Windows Terminal...
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "$p='%SCRIPT_PATH%'; Start-Process -FilePath '%wtPath%' -ArgumentList @('PowerShell','-NoProfile','-ExecutionPolicy','Bypass','-File',$p) -Verb RunAs" >> "%logFile%" || call :Error "PowerShell command failed"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "$p='%SCRIPT_PATH%'; $q=[char]34; Start-Process -FilePath '%wtPath%' -ArgumentList ('PowerShell -NoProfile -ExecutionPolicy Bypass -File ' + $q + $p + $q) -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 -NoProfile -ExecutionPolicy Bypass -Command "$p='%SCRIPT_PATH%'; Start-Process PowerShell -ArgumentList @('-NoProfile','-ExecutionPolicy','Bypass','-File',$p) -Verb RunAs" >> "%logFile%" || call :Error "PowerShell command failed"
PowerShell -NoProfile -ExecutionPolicy Bypass -Command "$p='%SCRIPT_PATH%'; $q=[char]34; Start-Process PowerShell -ArgumentList ('-NoProfile -ExecutionPolicy Bypass -File ' + $q + $p + $q) -Verb RunAs" >> "%logFile%" || call :Error "PowerShell command failed"
call :Log Script execution passed successfully to Win11Debloat.ps1
)