error 0x80070002 when launching `powershell.exe' #8342

Closed
opened 2026-01-31 01:26:55 +00:00 by claunia · 30 comments
Owner

Originally created by @sadalhayat on GitHub (May 20, 2020).

Environment

Windows build number: 10.0.18363.778
Windows Terminal version: 1.0.1401.0 Store/GitHub & 1.0.1402.0 Preview

Steps to reproduce

Open Windows Terminal or open new tab Windows PowerShell

Expected behavior

Windows PowerShell is open

Actual behavior

Error message: [error 0x80070002 when launching `powershell.exe']

image

Originally created by @sadalhayat on GitHub (May 20, 2020). <!-- 🚨🚨🚨🚨🚨🚨🚨🚨🚨🚨 I ACKNOWLEDGE THE FOLLOWING BEFORE PROCEEDING: 1. If I delete this entire template and go my own path, the core team may close my issue without further explanation or engagement. 2. If I list multiple bugs/concerns in this one issue, the core team may close my issue without further explanation or engagement. 3. If I write an issue that has many duplicates, the core team may close my issue without further explanation or engagement (and without necessarily spending time to find the exact duplicate ID number). 4. If I leave the title incomplete when filing the issue, the core team may close my issue without further explanation or engagement. 5. If I file something completely blank in the body, the core team may close my issue without further explanation or engagement. All good? Then proceed! --> <!-- This bug tracker is monitored by Windows Terminal development team and other technical folks. **Important: When reporting BSODs or security issues, DO NOT attach memory dumps, logs, or traces to Github issues**. Instead, send dumps/traces to secure@microsoft.com, referencing this GitHub issue. If this is an application crash, please also provide a Feedback Hub submission link so we can find your diagnostic data on the backend. Use the category "Apps > Windows Terminal (Preview)" and choose "Share My Feedback" after submission to get the link. Please use this form and describe your issue, concisely but precisely, with as much detail as possible. --> # Environment ```none Windows build number: 10.0.18363.778 Windows Terminal version: 1.0.1401.0 Store/GitHub & 1.0.1402.0 Preview ``` # Steps to reproduce Open Windows Terminal or open new tab Windows PowerShell # Expected behavior Windows PowerShell is open # Actual behavior Error message: [error 0x80070002 when launching `powershell.exe'] ![image](https://user-images.githubusercontent.com/18193764/82456284-3d4b8c80-9ade-11ea-9608-0ca787024f1a.png)
claunia added the Needs-TriageNeeds-Tag-FixNeeds-Attention labels 2026-01-31 01:26:55 +00:00
Author
Owner

@DHowett commented on GitHub (May 21, 2020):

Weird, this seems like a file not found error. You haven't changed your settings at all? What architecture are you on?

@DHowett commented on GitHub (May 21, 2020): Weird, this seems like a _file not found_ error. You haven't changed your settings at all? What architecture are you on?
Author
Owner

@EWNew commented on GitHub (May 21, 2020):

same error

@EWNew commented on GitHub (May 21, 2020): same error
Author
Owner

@sadalhayat commented on GitHub (May 21, 2020):

Weird, this seems like a file not found error. You haven't changed your settings at all? What architecture are you on?

Windows 10 Pro 64-bit.
No issue if I run powershell from Start Menu » Run or from right click Start button » PowerShell

@sadalhayat commented on GitHub (May 21, 2020): > Weird, this seems like a _file not found_ error. You haven't changed your settings at all? What architecture are you on? Windows 10 Pro 64-bit. No issue if I run powershell from Start Menu » Run or from right click Start button » PowerShell
Author
Owner

@qiye2019 commented on GitHub (May 21, 2020):

同样的问题,无法解决

@qiye2019 commented on GitHub (May 21, 2020): 同样的问题,无法解决
Author
Owner

@hola-str commented on GitHub (May 22, 2020):

Just add the path of the power shell to the environment variable

@hola-str commented on GitHub (May 22, 2020): Just add the path of the power shell to the environment variable
Author
Owner

@sadalhayat commented on GitHub (May 23, 2020):

Just add the path of the power shell to the environment variable

Thank you. It works!
%systemroot%\System32\WindowsPowerShell\v1.0

image

@sadalhayat commented on GitHub (May 23, 2020): > > Just add the path of the power shell to the environment variable Thank you. It works! ```%systemroot%\System32\WindowsPowerShell\v1.0``` ![image](https://user-images.githubusercontent.com/18193764/82724371-d0afd800-9cff-11ea-874f-da75172fc889.png)
Author
Owner

@EWNew commented on GitHub (May 23, 2020):

Just add the path of the power shell to the environment variable

Thanks.

@EWNew commented on GitHub (May 23, 2020): > Just add the path of the power shell to the environment variable Thanks.
Author
Owner

@qiye2019 commented on GitHub (May 25, 2020):

Just add the path of the power shell to the environment variable

thanks,it works

@qiye2019 commented on GitHub (May 25, 2020): > Just add the path of the power shell to the environment variable thanks,it works
Author
Owner

@DHowett commented on GitHub (May 25, 2020):

Looks like this is resolved, thanks’

@DHowett commented on GitHub (May 25, 2020): Looks like this is resolved, thanks’
Author
Owner

@vincent1890 commented on GitHub (Jun 12, 2020):

Just add the path of the power shell to the environment variable

Cool thanks,it works

@vincent1890 commented on GitHub (Jun 12, 2020): > Just add the path of the power shell to the environment variable Cool thanks,it works
Author
Owner

@TheNextUchiha commented on GitHub (Jun 18, 2020):

Just add the path of the power shell to the environment variable

Thank you. It works!
%systemroot%\System32\WindowsPowerShell\v1.0

image

It worked like a charm! Thanks, man. ❤️

@TheNextUchiha commented on GitHub (Jun 18, 2020): > > > > Just add the path of the power shell to the environment variable > > Thank you. It works! > ```%systemroot%\System32\WindowsPowerShell\v1.0``` > > ![image](https://user-images.githubusercontent.com/18193764/82724371-d0afd800-9cff-11ea-874f-da75172fc889.png) > It worked like a charm! Thanks, man. ❤️
Author
Owner

@noczz commented on GitHub (Jun 25, 2020):

Just add the path of the power shell to the environment variable

thanks

@noczz commented on GitHub (Jun 25, 2020): > > > Just add the path of the power shell to the environment variable thanks
Author
Owner

@kbrilla commented on GitHub (Jul 7, 2020):

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

@kbrilla commented on GitHub (Jul 7, 2020): 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](https://user-images.githubusercontent.com/22288449/86794442-d3c31580-c06c-11ea-9b61-f76fa19e6385.png)
Author
Owner

@Lilkedus commented on GitHub (Sep 27, 2020):

Just add the path of the power shell to the environment variable

Thank you so much it works!

@Lilkedus commented on GitHub (Sep 27, 2020): > Just add the path of the power shell to the environment variable Thank you so much it works!
Author
Owner

@ouija commented on GitHub (Oct 31, 2020):

I suddenly had this issue occur today, not quite sure what has caused it since I haven't modified any path or env variables at all. Also discovered that I needed to also add %systemroot%\System32 to the PATH variable as well, since apps like ping were no longer working from PowerShell or Command Prompt.... (good 'ol Windows 10)

@ouija commented on GitHub (Oct 31, 2020): I suddenly had this issue occur today, not quite sure what has caused it since I haven't modified any path or env variables at all. Also discovered that I needed to also add `%systemroot%\System32` to the PATH variable as well, since apps like `ping` were no longer working from PowerShell or Command Prompt.... _(good 'ol Windows 10)_
Author
Owner

@StephenHodgson commented on GitHub (Nov 16, 2020):

Also ran into this today. Wondering if it was part of the windows update that just rolled out. I have not changed my env vars in quite some time.

@StephenHodgson commented on GitHub (Nov 16, 2020): Also ran into this today. Wondering if it was part of the windows update that just rolled out. I have not changed my env vars in quite some time.
Author
Owner

@StephenHodgson commented on GitHub (Nov 16, 2020):

Looked into this a bit more the 20H2 windows build completely wiped out my PATHs in my computers env variables.

[edit]
Upgraded a second machine to 20H2 with the same results. My system environment paths got completely wiped.

@StephenHodgson commented on GitHub (Nov 16, 2020): Looked into this a bit more the 20H2 windows build completely wiped out my PATHs in my computers env variables. [edit] Upgraded a second machine to 20H2 with the same results. My system environment paths got completely wiped.
Author
Owner

@evertoncristiano commented on GitHub (Jan 27, 2021):

Thanks

@evertoncristiano commented on GitHub (Jan 27, 2021): Thanks
Author
Owner

@BossySmaxx commented on GitHub (Jan 30, 2021):

Just add the path of the power shell to the environment variable

Thank you. It works!
%systemroot%\System32\WindowsPowerShell\v1.0

image

yeah man this wokrs, really worked

@BossySmaxx commented on GitHub (Jan 30, 2021): > > Just add the path of the power shell to the environment variable > > Thank you. It works! > `%systemroot%\System32\WindowsPowerShell\v1.0` > > ![image](https://user-images.githubusercontent.com/18193764/82724371-d0afd800-9cff-11ea-874f-da75172fc889.png) yeah man this wokrs, really worked
Author
Owner

@chenzhekl commented on GitHub (Feb 2, 2021):

I encountered the same problem while launching Windows Terminal via the "Open in Windows Terminal" context menu. Everything works fine if I directly open Windows Terminal by clicking its icon.

P.S. I have powershell in the PATH env variable.

@chenzhekl commented on GitHub (Feb 2, 2021): I encountered the same problem while launching Windows Terminal via the "Open in Windows Terminal" context menu. Everything works fine if I directly open Windows Terminal by clicking its icon. P.S. I have `powershell` in the `PATH` env variable.
Author
Owner

@braindotai commented on GitHub (Mar 16, 2021):

Just add the path of the power shell to the environment variable

Thanks a lot, works like champ :)

@braindotai commented on GitHub (Mar 16, 2021): > Just add the path of the power shell to the environment variable Thanks a lot, works like champ :)
Author
Owner

@jraval commented on GitHub (Mar 20, 2021):

Why does this work? What's going on that this problem occurred in the first place?

@jraval commented on GitHub (Mar 20, 2021): Why does this work? What's going on that this problem occurred in the first place?
Author
Owner

@DHowett commented on GitHub (Mar 20, 2021):

@jraval the core issue is that the installation path for PowerShell has been removed from the system PATH, probably by some poorly-behaved software.

@DHowett commented on GitHub (Mar 20, 2021): @jraval the core issue is that the installation path for PowerShell has been removed from the system `PATH`, probably by some poorly-behaved software.
Author
Owner

@Naresh-CD commented on GitHub (Sep 10, 2021):

Hi Guys,

I have tried the solution multiple times but still getting the issue once I close the terminal. Can you please help me out?

image

image

@Naresh-CD commented on GitHub (Sep 10, 2021): Hi Guys, I have tried the solution multiple times but still getting the issue once I close the terminal. Can you please help me out? ![image](https://user-images.githubusercontent.com/81788376/132814042-dec8e45c-71ca-45d3-b485-4c9ff7690d45.png) ![image](https://user-images.githubusercontent.com/81788376/132814160-5a5a4dc0-df86-4b3b-9d76-4decd950327f.png)
Author
Owner

@dylanpoll commented on GitHub (Sep 11, 2021):

Hi Guys,

I have tried the solution multiple times but still getting the issue once I close the terminal. Can you please help me out?

I am also going through this one. at first I thought it had to do with validation signatures as within vsc I was having issues as well, so after doing the above I went back and incrementally between reboots disabled signing validations from within windows features but no go there as well. it is odd, I have powershell now working with vsc after running

bcdedit /set nointegritychecks on

and

Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass

but windows terminal is still the same exact error as listed for you.

I have a restore point for 9/4 but nothing update wise on the listed restored apps/drivers seems related, I don't know when the change hit me as I wasn't using it for a few days now and can't really dig through event viewer to find it that way tbh....

I don't know what caused it, but using a system restore to before some windows updates went through seems to have resolved it. I am a bit confused to be honest but I stop searching for a solution here.

@dylanpoll commented on GitHub (Sep 11, 2021): > > > Hi Guys, > > I have tried the solution multiple times but still getting the issue once I close the terminal. Can you please help me out? > I am also going through this one. at first I thought it had to do with validation signatures as within vsc I was having issues as well, so after doing the above I went back and incrementally between reboots disabled signing validations from within windows features but no go there as well. it is odd, I have powershell now working with vsc after running bcdedit /set nointegritychecks on and Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass but windows terminal is still the same exact error as listed for you. I have a restore point for 9/4 but nothing update wise on the listed restored apps/drivers seems related, I don't know when the change hit me as I wasn't using it for a few days now and can't really dig through event viewer to find it that way tbh.... I don't know what caused it, but using a system restore to before some windows updates went through seems to have resolved it. I am a bit confused to be honest but I stop searching for a solution here.
Author
Owner

@hanhathuy2612 commented on GitHub (Jan 11, 2022):

Just add the path of the power shell to the environment variable

Thank you. It works! %systemroot%\System32\WindowsPowerShell\v1.0

image

It not work for me

@hanhathuy2612 commented on GitHub (Jan 11, 2022): > > Just add the path of the power shell to the environment variable > > Thank you. It works! `%systemroot%\System32\WindowsPowerShell\v1.0` > > ![image](https://user-images.githubusercontent.com/18193764/82724371-d0afd800-9cff-11ea-874f-da75172fc889.png) It not work for me
Author
Owner

@fahrulseptiana commented on GitHub (Mar 8, 2022):

I encountered the same problem while launching Windows Terminal via the "Open in Windows Terminal" context menu. Everything works fine if I directly open Windows Terminal by clicking its icon.

P.S. I have powershell in the PATH env variable.

Same error here

@fahrulseptiana commented on GitHub (Mar 8, 2022): > I encountered the same problem while launching Windows Terminal via the "Open in Windows Terminal" context menu. Everything works fine if I directly open Windows Terminal by clicking its icon. > > P.S. I have `powershell` in the `PATH` env variable. Same error here
Author
Owner

@owaisishtiaqsiddiqui commented on GitHub (May 19, 2024):

Just add the path of the power shell to the environment variable

Thank you. It works! %systemroot%\System32\WindowsPowerShell\v1.0

image

I did this but it does not work for mw

@owaisishtiaqsiddiqui commented on GitHub (May 19, 2024): > > Just add the path of the power shell to the environment variable > > Thank you. It works! `%systemroot%\System32\WindowsPowerShell\v1.0` > > ![image](https://user-images.githubusercontent.com/18193764/82724371-d0afd800-9cff-11ea-874f-da75172fc889.png) I did this but it does not work for mw
Author
Owner

@gsudhan commented on GitHub (Aug 10, 2024):

Somehow my powershell.exe got deleted in that path, copy pasted it from a similar machine, it works now.

@gsudhan commented on GitHub (Aug 10, 2024): Somehow my powershell.exe got deleted in that path, copy pasted it from a similar machine, it works now.
Author
Owner

@owaisishtiaqsiddiqui commented on GitHub (Aug 10, 2024):

Somehow my powershell.exe got deleted in that path, copy pasted it from a similar machine, it works now.

What do you mean?

@owaisishtiaqsiddiqui commented on GitHub (Aug 10, 2024): > Somehow my powershell.exe got deleted in that path, copy pasted it from a similar machine, it works now. What do you mean?
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#8342