Terminal: when i open the windows terminal ,it`s show [error 0x80070002 when launching `powershell.exe']

Created on 15 Jan 2020  Â·  29Comments  Â·  Source: microsoft/terminal

when i open the windows terminal ,its show [error 0x80070002 when launchingpowershell.exe']

Needs-Author-Feedback Needs-Tag-Fix Needs-Triage

Most helpful comment

It seems that your PATH environment variable may be damaged and not contain the Windows PowerShell directory.
@pc-chin is your python executable named python3.8.exe or is it named python3.exe? If it is python3.exe, you will never be able to call it python3.8 and have it work properly.

I have the same problem. I know that my PATH variables are damaged, WT was not working before 0.8.10091.0

I think in some windows update my PATH got messed up. I have faced many problems because of it. Currently I cannot reinstall everything, Can we fix the path variables ?

When I try to launch PS from cmd, cmd cannot find PS, but the same is not true for my Windows sandbox env.

I am just hoping to fix my PATH, and use WT easily.

Thanks,
Malhar

Edit:

image

Windows sandbox

image

My current env

image
my WT
CMD and WSL work correctly in WT

After updating my PATH with %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ at the top of the list, it seems to be working now
image
My CMD can call PS now !

image
WT runs PS

All 29 comments

A similar problem occured to me when using Python. When I set commandline as "python3.8", it would show [error 0x80070002 ...]. However, when I set commandline as "python3" the issue does not occur.

It seems that your PATH environment variable may be damaged and not contain the Windows PowerShell directory.

@pc-chin is your python executable named python3.8.exe or is it named python3.exe? If it is python3.exe, you will never be able to call it python3.8 and have it work properly.

It seems that your PATH environment variable may be damaged and not contain the Windows PowerShell directory.

@pc-chin is your python executable named python3.8.exe or is it named python3.exe? If it is python3.exe, you will never be able to call it python3.8 and have it work properly.

I have the same problem. I know that my PATH variables are damaged, WT was not working before 0.8.10091.0

I think in some windows update my PATH got messed up. I have faced many problems because of it. Currently I cannot reinstall everything, Can we fix the path variables ?

When I try to launch PS from cmd, cmd cannot find PS, but the same is not true for my Windows sandbox env.

I am just hoping to fix my PATH, and use WT easily.

Thanks,
Malhar

Edit:

image

Windows sandbox

image

My current env

image
my WT
CMD and WSL work correctly in WT

It seems that your PATH environment variable may be damaged and not contain the Windows PowerShell directory.
@pc-chin is your python executable named python3.8.exe or is it named python3.exe? If it is python3.exe, you will never be able to call it python3.8 and have it work properly.

I have the same problem. I know that my PATH variables are damaged, WT was not working before 0.8.10091.0

I think in some windows update my PATH got messed up. I have faced many problems because of it. Currently I cannot reinstall everything, Can we fix the path variables ?

When I try to launch PS from cmd, cmd cannot find PS, but the same is not true for my Windows sandbox env.

I am just hoping to fix my PATH, and use WT easily.

Thanks,
Malhar

Edit:

image

Windows sandbox

image

My current env

image
my WT
CMD and WSL work correctly in WT

After updating my PATH with %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ at the top of the list, it seems to be working now
image
My CMD can call PS now !

image
WT runs PS

This issue has been automatically marked as stale because it has been marked as requiring author feedback but has not had any activity for 4 days. It will be closed if no further activity occurs within 3 days of this comment.

This bug still exists and should be reopened.

It seems that your PATH environment variable may be damaged and not contain the Windows PowerShell directory.
@pc-chin is your python executable named python3.8.exe or is it named python3.exe? If it is python3.exe, you will never be able to call it python3.8 and have it work properly.

I have the same problem. I know that my PATH variables are damaged, WT was not working before 0.8.10091.0
I think in some windows update my PATH got messed up. I have faced many problems because of it. Currently I cannot reinstall everything, Can we fix the path variables ?
When I try to launch PS from cmd, cmd cannot find PS, but the same is not true for my Windows sandbox env.
I am just hoping to fix my PATH, and use WT easily.
Thanks,
Malhar
Edit:
image
Windows sandbox
image
My current env
image
my WT
CMD and WSL work correctly in WT

After updating my PATH with %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\ at the top of the list, it seems to be working now
image
My CMD can call PS now !

image
WT runs PS

Have you tried this solution ?

@OnurGumus You've gotta provide us some information - this issue was closed because we asked the author for feedback and they didn't respond. What commandline are you trying to run in the Terminal, and is that application on the PATH?

I've added this to both my User and System Environment Variables (At the top line) and am still getting this same error when trying to launch Powershell from cmd

wt -d c:\scripts "Windows PowerShell"

from cmd prompt, results in

wt -d c:\scripts "Windows PowerShell"

“Windows Powershell” is the name of a profile, not an executable, so you must put -p before it.

So, I'm having the same issue with all terminals WT has available to me:
[error 0xd0000022 when launching 'powershell.exe']

[error 0xd0000022 when launching 'cmd.exe']

[error 0xd0000022 when launching 'wsl.exe -d Ubuntu']

[error 0xd0000022 when launching 'C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1401.0_x64__8wekyb3d8bbwe\TerminalAzBridge.exe']

Is it possible that my PATH is broken for everything? Powershell, Cmd and Ubuntu's Terminal work fine for me from outside WT

Moved my powershell line to the top of Path but no success.

So, the last report we got of 0xd0000022 was https://github.com/microsoft/terminal/issues/5488. Do any of the considerations in there apply to you?

I also have this issue

[error 0x80070002 when launching `cmd.exe']

@DHowett I tried to check the shortcuts from startmenu and none of the apps have the run as administration option enabled.

If I run WT as admin it works fine though. I tried another terminal called Hyper (written in Electron) and it won't even open if I don't run as Admin. I checked their issues on github and there's an fairly active topic about a bunch of people having the same issue.

Is there an exact location where I can check if these apps are running as admin? I would love to be able to use the wt anywhere by just typing wt (if I was in another terminal or something like that) but because I can't force it to run as Admin it won't work :(

i have the same problem when trying to install link-preview,

C:\Users\User>wt install link-preview

and then it goes :

[error 0x80070002 when launching 'install link-preview']

link-preview

Sorry about that. We don’t actually have extensions or the “wt install” command right now. We are tracking that in #4000

link-preview

Sorry about that. We don’t actually have extensions or the “wt install” command right now. We are tracking that in #4000

https://youtu.be/8gw0rXPMMPE?t=27

But in the video you showed it!

The video also shows a terminal that is _literally made of glass_ and _floating in space_. Some of the things in there are planned, some of them are stylistic. The link preview you're looking for is being tracked in #4000.

guys I found solution!
basicly go to C:\Program Files\WindowsApps\Microsoft.WindowsTerminal_1.0.1811.0_x64__8wekyb3d8bbwe //or wherever You app is instaled

copy the content to another folder, somewhere where You definitely have access to modify, i used new folder on my desktop

last step run WindowsTerminal.exe from that folder as admin.

image

I have installed Windows PowerShell 7 and in my settings.json file, I have included:

{
  "guid": "{fb0ad4d6-a0de-48b8-8feb-14df8467ad31}",
  "hidden": false,
  "name": "Windows PowerShell 7",
  "commandline": "pwsh.exe"
}

Now when I am starting this profile, it says:
[error 0x80070002 when launchingpwsh.exe']`

We need to reopen this issue.
I'm going to open new issue hoping able to merge back.

@Limyx826 Please make sure to look through existing issues for a duplicate before filing a new issue. Thanks!

@Limyx826 Please make sure to look through existing issues for a duplicate before filing a new issue. Thanks!

@zadjii-msft This thread is the issue

Windows build number: Microsoft Windows [Version 10.0.18363.959]
Windows Terminal version: 1.1.2021.0

For some reason Windows PowerShell path is broken. When I tried to open PowerShell, it will shown [error 0x80070002 when launching `powershell.exe'].

This issue doesn't occur one my pc is Windows 10 Version 10.0.19041.423 which I rolled back from.

image

Edit your settings and delete the line that says “commandline: powershell.exe”.

You will want to check your system PATH, because it no longer has PowerShell on it. That is going to break a few things, not just terminal. At least by removing this config option from Terminal you’ll be able to use it.

Edit your settings and delete the line that says “commandline: powershell.exe”.

Well this worked, thanks.

In case this helps someone else.

Installing a preview version of Powershell 7 places the following in the PATH:
C:\Program Files\PowerShell\7-preview\preview

Which contains pwsh-preview.cmd not pwsh.exe. So pwsh or pwsh.exe will not work.

Change this to C:\Program Files\PowerShell\7-preview\ and it works fine.

PLEASE READ THIS. Alright so after some research I realised that the problem is with the environment variable. Open Environmental Variables and under System Variables, click on "PATH" and then click new. Now add this - %SystemRoot%system32
Click exit, now restart your System. Everything should be working perfectly fine now. Glad I could help!

Was this page helpful?
0 / 5 - 0 ratings