winget-cli: Program 'winget.exe' failed to run at line 1 char 1
Brief description of your issue
Typing winget on powershell or cmd just throws error.
Steps to reproduce
Nothing special, applied to Insider program and tried install new App Manager via microsoft store.
Expected behavior
Having winget app working
Actual behavior
Typing winget returns:
Program 'winget.exe' failed to run: The system cannot find the file specified
At line:1 char:1
+ winget
+ ~~~~~~.
In riga:1 car:1
+ winget
+ ~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
I then tried debugging it:
PS C:\Users\Admin>Trace-Command -Expression {winget} -Name CommandDiscovery -PSHost | out-null
DEBUG: CommandDiscovery Information: 0 : Looking up command: winget
... skipping all path discovery ...
DEBUG: CommandDiscovery Information: 0 : Command Found: path (C:\Users\Admin\AppData\Local\Microsoft\WindowsApps\winget.exe) is an application with name: winget.exe
DEBUG: CommandDiscovery Information: 0 : Looking up command: Set-StrictMode
DEBUG: CommandDiscovery Information: 0 : Cmdlet found: Set-StrictMode Microsoft.PowerShell.Commands.SetStrictModeCommand
DEBUG: CommandDiscovery Information: 0 : Looking up command: Set-StrictMode
DEBUG: CommandDiscovery Information: 0 : Cmdlet found: Set-StrictMode Microsoft.PowerShell.Commands.SetStrictModeCommand
DEBUG: CommandDiscovery Information: 0 : Looking up command: Set-StrictMode
DEBUG: CommandDiscovery Information: 0 : Cmdlet found: Set-StrictMode Microsoft.PowerShell.Commands.SetStrictModeCommand
DEBUG: CommandDiscovery Information: 0 : Looking up command: Set-StrictMode
DEBUG: CommandDiscovery Information: 0 : Cmdlet found: Set-StrictMode Microsoft.PowerShell.Commands.SetStrictModeCommand
Program 'winget.exe' failed to run: The system cannot find the file specified
At line:1 char:28
+ Trace-Command -Expression {winget} -Name CommandDiscovery -PSHost | o ...
+ ~~~~~~.
At line:1 char:28
+ Trace-Command -Expression {winget} -Name CommandDiscovery -PSHost | o ...
+ ~~~~~~
+ CategoryInfo : ResourceUnavailable: (:) [], ApplicationFailedException
+ FullyQualifiedErrorId : NativeCommandFailed
Environment
[winget --info]
Windows Package Manager version Can't run winget do I can't say it for sure
Windows: Windows.Desktop version 10.0.19042 N/D build 19042 (if this is the value needed)
Package: Microsoft.DesktopAppInstaller version - Windows Store doesn't state the version
Any other software? WSL and hyper-v enabled
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 3
- Comments: 15 (6 by maintainers)
I’m getting the same error after installing the latest version from an administrative PowerShell session.
Hi, this is still happening to me. The installer from the github page says a new version is already installed, but I get exactly this error.