The -NoLogo argument to PowerShell does not work #18417

Closed
opened 2026-01-31 06:13:19 +00:00 by claunia · 3 comments
Owner

Originally created by @Tembocs on GitHub (Sep 11, 2022).

Windows Terminal version

1.14.2282.0

Windows build number

10.0.22000.0

Other Software

PowerShell version 7.2.6

Steps to reproduce

Start Windows Terminal
Go to settings then PowerShell (under Profiles)
Go to Command line and add -NoLogo so that it is "C:\Program Files\PowerShell\7\pwsh.exe -NoLogo"
Restart Windows Terminal
The following error message shows up [error 2147942402 (0x80070002) when launching '"C:\Program Files\PowerShell\7\pwsh.exe -NoLogo"']

Expected Behavior

I would expect Windows Terminal to start normally with PowerShell profile without the PowerShell banner because that is what -NoLogo argument is for, hiding the banner.

Actual Behavior

The actual behaviour is the error message[error 2147942402 (0x80070002) when launching "C:\Program Files\PowerShell\7\pwsh.exe -NoLogo"']

However if I use JSON settings to set "commandline": "C:/Program Files/PowerShell/7/pwsh.exe -NoLogo" for PowerShell profile this works as expected without any error.

Originally created by @Tembocs on GitHub (Sep 11, 2022). ### Windows Terminal version 1.14.2282.0 ### Windows build number 10.0.22000.0 ### Other Software PowerShell version 7.2.6 ### Steps to reproduce Start Windows Terminal Go to settings then PowerShell (under Profiles) Go to Command line and add `-NoLogo` so that it is `"C:\Program Files\PowerShell\7\pwsh.exe -NoLogo"` Restart Windows Terminal The following error message shows up `[error 2147942402 (0x80070002) when launching '"C:\Program Files\PowerShell\7\pwsh.exe -NoLogo"']` ### Expected Behavior I would expect Windows Terminal to start normally with PowerShell profile without the PowerShell banner because that is what `-NoLogo` argument is for, hiding the banner. ### Actual Behavior The actual behaviour is the error message`[error 2147942402 (0x80070002) when launching "C:\Program Files\PowerShell\7\pwsh.exe -NoLogo"']` However if I use JSON settings to set `"commandline": "C:/Program Files/PowerShell/7/pwsh.exe -NoLogo"` for PowerShell profile this works as expected without any error.
claunia added the Needs-TriageIssue-BugNeeds-Tag-FixNeeds-Attention labels 2026-01-31 06:13:20 +00:00
Author
Owner

@237dmitry commented on GitHub (Sep 11, 2022):

You have to escape slash with one more slash \\ in JSON.

@237dmitry commented on GitHub (Sep 11, 2022): You have to escape slash with one more slash `\\` in JSON.
Author
Owner

@lhecker commented on GitHub (Sep 11, 2022):

"C:\Program Files\PowerShell\7\pwsh.exe -NoLogo"

in the settings UI translates to

"\"C:\Program Files\PowerShell\7\pwsh.exe -NoLogo\""

in the settings.json file and "pwsh.exe -NoLogo" is not an executable that exists on your computer.
This results in 0x80070002 which translates to "The system cannot find the file specified." (ERROR_FILE_NOT_FOUND).

Try writing this in the settings UI instead:

"C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo

If this resolves your problem, please feel free to close this issue. 🙂

@lhecker commented on GitHub (Sep 11, 2022): ``` "C:\Program Files\PowerShell\7\pwsh.exe -NoLogo" ``` in the settings UI translates to ``` "\"C:\Program Files\PowerShell\7\pwsh.exe -NoLogo\"" ``` in the settings.json file and "pwsh.exe -NoLogo" is not an executable that exists on your computer. This results in `0x80070002` which translates to "The system cannot find the file specified." (`ERROR_FILE_NOT_FOUND`). Try writing this in the settings UI instead: ``` "C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo ``` If this resolves your problem, please feel free to close this issue. 🙂
Author
Owner

@Tembocs commented on GitHub (Sep 12, 2022):

@lhecker this works, thanks.

@Tembocs commented on GitHub (Sep 12, 2022): @lhecker this works, thanks.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#18417