[error 2147942402 (0x80070002) when launching `pwsh.exe -NoLogo'] #21331

Closed
opened 2026-01-31 07:41:19 +00:00 by claunia · 7 comments
Owner

Originally created by @danielniccoli on GitHub (Feb 29, 2024).

Windows Terminal version

1.19.10573.0

Windows build number

10.0.22621.0

Other Software

No response

Steps to reproduce

  1. Use the following settings.json
{
    "$help": "https://aka.ms/terminal-documentation",
    "$schema": "https://aka.ms/terminal-profiles-schema",
    "actions": [], // Removed for brevity
    "copyFormatting": "all",
    "copyOnSelect": false,
    "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
    "newTabMenu": 
    [
        {
            "type": "remainingProfiles"
        }
    ],
    "profiles": 
    {
        "defaults": 
        {
            "antialiasingMode": "cleartype",
            "font": 
            {
                "size": 10.0
            },
            "opacity": 90,
            "useAcrylic": true
        },
        "list": 
        [
            {
                "commandline": "pwsh.exe -NoLogo",
                "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}",
                "hidden": false,
                "name": "PowerShell",
                "source": "Windows.Terminal.PowershellCore"
            },
            {
                "colorScheme": "Campbell Powershell",
                "commandline": "powershell.exe -NoLogo",
                "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}",
                "name": "Windows PowerShell"
            },
            {
                "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}",
                "name": "Command Prompt"
            },
            {
                "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}",
                "hidden": true,
                "name": "Azure Cloud Shell",
                "source": "Windows.Terminal.Azure"
            },
            {
                "guid": "{e5a83caa-4c73-52b3-ae6b-bc438d721ef9}",
                "hidden": false,
                "name": "Ubuntu 22.04.3 LTS",
                "source": "CanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc"
            }
        ]
    },
    "schemes": [], // Removed for brevity
    "themes": []
}
  1. Start Windows Terminal (which defaults to the PowerShell 7 profile with the guid "{574e775e-4f2a-5b96-ac1e-a2962a402336}" and the name "PowerShell".

Expected Behavior

Windows Terminal should start a PowerShell 7 terminal.

Actual Behavior

It shows [error 2147942402 (0x80070002) when launching ``pwsh.exe -NoLogo']

grafik

I was migrating the settings.json from my Windows 10 computer to a new Windows 11 computer. It was working before.

pwsh.exe is also in the path

grafik

Originally created by @danielniccoli on GitHub (Feb 29, 2024). ### Windows Terminal version 1.19.10573.0 ### Windows build number 10.0.22621.0 ### Other Software _No response_ ### Steps to reproduce 1. Use the following `settings.json` ```jsonc { "$help": "https://aka.ms/terminal-documentation", "$schema": "https://aka.ms/terminal-profiles-schema", "actions": [], // Removed for brevity "copyFormatting": "all", "copyOnSelect": false, "defaultProfile": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", "newTabMenu": [ { "type": "remainingProfiles" } ], "profiles": { "defaults": { "antialiasingMode": "cleartype", "font": { "size": 10.0 }, "opacity": 90, "useAcrylic": true }, "list": [ { "commandline": "pwsh.exe -NoLogo", "guid": "{574e775e-4f2a-5b96-ac1e-a2962a402336}", "hidden": false, "name": "PowerShell", "source": "Windows.Terminal.PowershellCore" }, { "colorScheme": "Campbell Powershell", "commandline": "powershell.exe -NoLogo", "guid": "{61c54bbd-c2c6-5271-96e7-009a87ff44bf}", "name": "Windows PowerShell" }, { "guid": "{0caa0dad-35be-5f56-a8ff-afceeeaa6101}", "name": "Command Prompt" }, { "guid": "{b453ae62-4e3d-5e58-b989-0a998ec441b8}", "hidden": true, "name": "Azure Cloud Shell", "source": "Windows.Terminal.Azure" }, { "guid": "{e5a83caa-4c73-52b3-ae6b-bc438d721ef9}", "hidden": false, "name": "Ubuntu 22.04.3 LTS", "source": "CanonicalGroupLimited.Ubuntu22.04LTS_79rhkp1fndgsc" } ] }, "schemes": [], // Removed for brevity "themes": [] } ``` 2. Start Windows Terminal (which defaults to the PowerShell 7 profile with the guid "{574e775e-4f2a-5b96-ac1e-a2962a402336}" and the name "PowerShell". ### Expected Behavior Windows Terminal should start a PowerShell 7 terminal. ### Actual Behavior It shows `[error 2147942402 (0x80070002) when launching ``pwsh.exe -NoLogo']` ![grafik](https://github.com/microsoft/terminal/assets/2971735/b5a81f78-7855-49c9-9fa6-59408a4af2e6) I was migrating the `settings.json` from my Windows 10 computer to a new Windows 11 computer. It was working before. pwsh.exe is also in the path ![grafik](https://github.com/microsoft/terminal/assets/2971735/80cdea20-56a2-4ae0-b2df-ec7e250d0525)
claunia added the Needs-TriageIssue-BugNeeds-Attention labels 2026-01-31 07:41:19 +00:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 29, 2024):

Hi I'm an AI powered bot that finds similar issues based off the issue title.

Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you!

Closed similar issues:

Note: You can give me feedback by thumbs upping or thumbs downing this comment.

@github-actions[bot] commented on GitHub (Feb 29, 2024): Hi I'm an AI powered bot that finds similar issues based off the issue title. Please view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it. Thank you! ### Closed similar issues: - [error 0x800700c1 when launching pwsh.exe (#11717)](https://github.com/microsoft/terminal/issues/11717), similarity score: 0.90 - [[error 2147943140 (0x800702e4) when launching `"C:\Program Files\PowerShell\7\pwsh.exe"'] (#14227)](https://github.com/microsoft/terminal/issues/14227), similarity score: 0.81 - [[error 0x800700c1 when launching `C:\Program Files\PowerShell\7\pwsh.exe'] (#10536)](https://github.com/microsoft/terminal/issues/10536), similarity score: 0.80 - [[error 0x800700c1 when launching `C:\Program Files\PowerShell\7\pwsh.exe'] (#10293)](https://github.com/microsoft/terminal/issues/10293), similarity score: 0.80 - [Error 0x800702e4 when launching `C:\Program Files\PowerShell\6\pwsh.exe'] (#4272)](https://github.com/microsoft/terminal/issues/4272), similarity score: 0.80 > Note: You can give me feedback by thumbs upping or thumbs downing this comment.
Author
Owner

@zadjii-msft commented on GitHub (Feb 29, 2024):

curious. Do other profiles work/? Especially the cmd.exe one - that should actually use the full path to cmd, whereas the other profiles are just relying on the pwsh that's found on the PATH. I'd mildly worried you caught our env var regeneration in a broken state.

If the cmd profile works, the output of a set PATH might be enlightening

@zadjii-msft commented on GitHub (Feb 29, 2024): curious. Do other profiles work/? Especially the cmd.exe one - that should actually use the full path to cmd, whereas the other profiles are just relying on the `pwsh` that's found on the PATH. I'd mildly worried you caught our env var regeneration in a broken state. If the `cmd` profile works, the output of a `set PATH` might be enlightening
Author
Owner

@danielniccoli commented on GitHub (Feb 29, 2024):

Do other profiles work?

Yes, you can see that also in the second screenshot I posted.

If the cmd profile works, the output of a set PATH might be enlightening

I may be able to provide that next week as I do not have access to the computer in the meantime. However, the where pwsh from the second screenshot should already proof that it is in the PATH, no?

@danielniccoli commented on GitHub (Feb 29, 2024): > Do other profiles work? Yes, you can see that also in the second screenshot I posted. > If the cmd profile works, the output of a set PATH might be enlightening I may be able to provide that next week as I do not have access to the computer in the meantime. However, the `where pwsh` from the second screenshot should already proof that it is in the `PATH`, no?
Author
Owner

@danielniccoli commented on GitHub (Mar 5, 2024):

Issue was solved without interaction after returning to my computer this week. I'm closing this issue as finding the root cause now is impossible.

@danielniccoli commented on GitHub (Mar 5, 2024): Issue was solved without interaction after returning to my computer this week. I'm closing this issue as finding the root cause now is impossible.
Author
Owner

@DHowett commented on GitHub (Mar 5, 2024):

Ah, thank you for following up!

@DHowett commented on GitHub (Mar 5, 2024): Ah, thank you for following up!
Author
Owner

@thrve commented on GitHub (Aug 12, 2024):

так должно быть:
"C:\Users\thrv\AppData\Local\Microsoft\WindowsApps\Microsoft.PowerShell_8wekyb3d8bbwe\pwsh.exe" "/nologo"

123

@thrve commented on GitHub (Aug 12, 2024): так должно быть: "C:\Users\thrv\AppData\Local\Microsoft\WindowsApps\Microsoft.PowerShell_8wekyb3d8bbwe\pwsh.exe" **"/nologo"** ![123](https://github.com/user-attachments/assets/f9b5c76d-7dd9-4874-9266-5fea79f45546)
Author
Owner

@apaladi commented on GitHub (Aug 28, 2024):

I have it like this:
%localappdata%\Microsoft\WindowsApps\Microsoft.PowerShell_8wekyb3d8bbwe\pwsh.exe

@apaladi commented on GitHub (Aug 28, 2024): I have it like this: `%localappdata%\Microsoft\WindowsApps\Microsoft.PowerShell_8wekyb3d8bbwe\pwsh.exe`
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#21331