"[Tutorial] Go Installation Set PATH environment variable - Windows 10"

Published: Mon 11 July 2016

In content.

This tutorial is written for those who are struggling to add new tools such ask android/sdk, android/platform-tools and golang installation. This tutorial should work on windows 7,8,10. This tutorial was written while installing Golang on Windows 10 Machine.

Proceed by starting command-line prompt with "Run As Administrator" privilege.

Start by typing:

[code lang=text] echo %PATH% [/code]

Output:

[code lang=text] C:\Users\Vigneshwaran\Documents\GoogleCloudPlatform>echo %PATH% C:\ProgramData\Oracle\Java\javapath;C:\Python27\;C:\Python27\Scripts;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Subversion\bin;C:\Program Files (x86)\CMake\bin;C:\Users\Vigneshwaran\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\gnuwin32\bin;C:\Program Files (x86)\PuTTY\;C:\PROGRA~2\Groovy\GROOVY~1.7\bin;C:\ProgramData\chocolatey\bin;C:\Program Files\nodejs\;C:\Program Files\Java\jdk1.8.0_92\bin;C:\Users\Vigneshwaran\AppData\Local\Android\android-sdk\tools;C:\Users\Vigneshwaran\AppData\Local\Android\android-sdk\platform-tools;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files (x86)\Microsoft Emulator Manager\1.0\;C:\Program Files\Git\cmd;C:\Program Files (x86)\Google\Cloud SDK\google-cloud-sdk\bin;C:\tools\go\bin;;C:\Users\Vigneshwaran\AppData\Local\Programs\Python\Python35-32\Scripts\;C:\Users\Vigneshwaran\AppData\Local\Programs\Python\Python35-32\;C:\Program Files\Java\jdk1.8.0_91\bin;C:\Program Files\Java\jdk1.8.0_91;C:\Program Files (x86)\clisp-2.49;C:\Program Files (x86)\PuTTY;C:\tools\dart-sdk\bin;C:\Users\Vigneshwaran\AppData\Roaming\Pub\Cache\bin;C:\Users\Vigneshwaran\AppData\Roaming\npm;C:\Program Files (x86)\Microsoft VS Code\bin;C:\Users\Vigneshwaran\AppData\Local\Android\sdk\platform-tools;C:\Users\Vigneshwaran\AppData\Local\Android\sdk\tools;C:\Program Files (x86)\Google\google_appengine\ [/code]

Then proceed by typing:

[code lang=text] setx PATH "%PATH%;C:\GO\bin" [/code]

then verify by:

[code lang=text] echo %PATH% [/code]

You should see ouput:

[code lang=text] C:\Users\Vigneshwaran\Documents\GoogleCloudPlatform>setx PATH "%PATH%;C:\GO\bin"

WARNING: The data being saved is truncated to 1024 characters.

SUCCESS: Specified value was saved. [/code]

Once you're done with it, type:

[code lang=text] refreshenv [/code]

To set GOPATH environment variable:

[code lang=text] setx GOPATH "%GOPATH%;C:\" [/code]

refresh your command prompt environment variables by typing:

[code lang=text] refreshenv [/code]

social