Use powershell to quickly set the environment variables on Windows

Instead of doing these steps in this screenshot

Set Windows Machine Environment Variable By CLI

you can run one command in CMD to achieve the same goal

powershell [System.Environment]::SetEnvironmentVariable('ANT_HOME', 'C:\tools\apache-ant-1.9.4\bin', 'Machine')

  • Set variable ANT_HOME
  • to Value C:\tools\apache-ant-1.9.4\bin
  • at Machine level

DONE!

Advertisements