I installed Chocolatey as per the instructions on the website (https://chocolatey.org/install).
The 'choco' command works fine when I run it normally on cmd but returns the following error when run as administrator:
C:\WINDOWS\system32>choco install -y wget 7zip.commandline
'choco' is not recognized as an internal or external command,
operable program or batch file.
The install choco install -y wget 7zip.commandline
fails if not run as administrator.
How do I fix 'not recognized' error in admin cmd?
Copy the below text into the command prompt.
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
Then press enter key from the keyboard. After few seconds you get complete info about current installation.
If you don't see any errors. Type choco
or choco -?
now.