[error 0x800700c1 when launching `C:\Program Files\PowerShell\7\pwsh.exe’]

I’ve recently upgraded to the latest Windows Terminal version (1.8.1521.0). Today after a well overdue restart of my computer, opening Windows Terminal with PowerShell configured as my default profile presented me with [error 0x800700c1 when launching `C:\Program Files\PowerShell\7\pwsh.exe’].

[error 0x800700c1 when launching `C:\Program Files\PowerShell\7\pwsh.exe']

Some quick searching to see if this was common turned up this old issue in the Windows Terminal GitHub Repo issues list. None of those suggestions were any good for me. I checked to see if PWSH was in fact in the C:\Program Files\PowerShell\7 path, and sure enough it is.

Fixing [error 0x800700c1 when launching `C:\Program Files\PowerShell\7\pwsh.exe’]

EDIT: 2 July 2021. It has transpired that an update
to the Citrix Receiver on my workstation had dumped
an install log into a file name 'program' in the
root of my C:\. Rename or delete that file and all
works as expected again. 

Going out on a limb and based on the historical issues I wondered if the space in the directory path was causing issues. I opened a command prompt and changed to the root of my C: drive and used the dir /x command to get the 8.3 formatted paths for files and directories.

On my computer c:\program files is c:\progra~1 in 8.3 DOS format.

Opening the Windows Terminal Settings and editing the PowerShell profile command line path, I changed the path from c:\program files\powershell\7\pwsh.exe to c:\progra~1\PowerShell\7\pwsh.exe and selected Save.

[error 0x800700c1 when launching `C:\Program Files\PowerShell\7\pwsh.exe'] path update

Reopening Windows Terminal, now gave me my PowerShell console as required and expected.

No [error 0x800700c1 when launching `C:\Program Files\PowerShell\7\pwsh.exe'] error


Sometimes old issues are new issues again. I’ve logged the issue on the Windows Terminal GitHub Repo here.