Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
72 views
in Technique[技术] by (71.8m points)

How to add a folder to `Path` environment variable in Windows 10 (with screenshots)

On StackOverflow and on the net in general, there are outdated and few guides on how to add a specific folder to the Windows 10 Path environment variable of the user.

I think a complete guide for new developers with step by step instructions and screenshots could be really usefull to help them executing utilities from a Command Prompt without the need of the full path, simplifying the things.

Question&Answers:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

For the guide below we want to add an example utility called mytool.exe which is located in C:UsersNewFolderInPathmytool.exe, so that everytime i want to execute the mytool utility i don't have to specify the full path.

I used this as an example, you can replace the folder with something more realistic like the JDK bin directory located here C:Program FilesJava{JDK_VERSION}in to execute javac, keytool or everything you want.

Step 1 - Click on the Windows icon

enter image description here

Step 2 - Click on the Settings icon

enter image description here

Step 3 - Click on System

enter image description here

Step 4 - Click on About

enter image description here

Step 5 - Click on System info

enter image description here

Step 6 - Click on Advanced system settings

enter image description here

Step 7 - Click on Environment variables...

enter image description here

Step 8 - Select Path row and then click Edit

enter image description here

Step 9 - Click New and then click Browse, then in the next panel which will open you need to select the folder you want in the Path. For the initial premise of this guide i will add the folder C:UsersNewFolderInPath

enter image description here

Step 10 - Click OK and click every OK button you will encounter to close every previous windows.

enter image description here

Step 11 - Open a command prompt (cmd) and now you can execute your utility without specifying the full path.

enter image description here

NOTE : For every problems leave a comment below and i will answer as soon as i can. Good luck and happy coding :)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...