Skip to content

Program 'winget.exe' failed to run at line 1 char 1 #712

Description

@raikoug

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Area-ExternalIssue outside of winget-cli sourceIssue-BugIt either shouldn't be doing this or needs an investigation.

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Done

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions