Winget is installed but not recognized when executing script using psexec

Matthias Veelaert 16 Reputation points

Hi there,

I have written a batch script to uninstall two programs from my local machine by using winget. When I run the script by double clicking or running as admin, it works. When I try to use PsExec to run the script, it says winget is not recognized.

Does anyone have a solution to this or is this a known issue?

Thanks in advance!!!!

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
10,831 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Limitless Technology 39,436 Reputation points

    Hello @Matthias Veelaert

    Usually the main issue when running PSEXEC when elevated permissions are required is that either UAC is enabled or the syntax is not adequate.

    Please try disabling UAC:

    Use the –h switch to indicate that PSEXEC will use elevation for execution. Reference:

    Hope this helps with your query,


    --If the reply is helpful, please Upvote and Accept as answer--

    0 comments No comments