Skip to content

[🪲 BUG] run.bat missing quotation for Powershell path, fails if Powershell is located in "C:\Program Files" #17

@tristen-adams

Description

@tristen-adams

Without quotations around %PS_EXE% and the user's Powershell.exe is located in C:\Program Files, the script fails with the following error popup.

Title: C:\Program
Text: Windows cannot find 'C:\Program'. Make sure you typed the name correctly, and then try again.

Image

This error can be solved by adding quotations around %PS_EXE% in the conditional statement for %MENUOPT%.

Original:

if "%MENUOPT%"=="1" (
    echo [INFO] Launching interactive script in a new PowerShell window...
    start "TelemetryBlocker-Interactive" %PS_EXE% -NoProfile -ExecutionPolicy Bypass -File "%PS_SCRIPT%" -Interactive -EnableAuditLog
    exit /b
)

Modified

if "%MENUOPT%"=="1" (
    echo [INFO] Launching interactive script in a new PowerShell window...
    start "TelemetryBlocker-Interactive" "%PS_EXE%" -NoProfile -ExecutionPolicy Bypass -File "%PS_SCRIPT%" -Interactive -EnableAuditLog
    exit /b
)

All that I changed was %PS_EXE% -> "%PS_EXE%", and the script was able to correctly locate Powershell.exe.
I have not tested any options other than "1. Run Interactive Script (Reccomended)", so I can't say if the issue persists in other locations.

Metadata

Metadata

Assignees

Labels

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions