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?
Verify Installation To verify that Chocolatey is installed, we will use the choco command. C:\WINDOWS\system32>choco Chocolatey v0. 10.15 Please run 'choco -? ' or 'choco -?
Install via Command LinePress the Windows key and type "cmd". Select the Run as administrator option. Wait for the installation process to finish to start using Chocolatey. Note: Make sure to close and reopen the shell before using Chocolatey to ensure all the environment variables are loaded correctly.
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.
Reference
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With