如何在Windows 10中将文件夹添加到`Path`环境变量中(带有屏幕截图) [英] How to add a folder to `Path` environment variable in Windows 10 (with screenshots)
问题描述
在StackOverflow和一般的网络上,关于如何向用户的Windows 10 Path
环境变量添加特定文件夹的指南已经过时,并且指南很少.
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.
推荐答案
对于下面的指南,我们想添加一个位于C:\Users\NewFolderInPath\mytool.exe
中的名为mytool.exe
的示例实用程序,以便每次我想执行mytool实用程序时我不必指定完整路径.
For the guide below we want to add an example utility called mytool.exe
which is located in C:\Users\NewFolderInPath\mytool.exe
, so that everytime i want to execute the mytool utility i don't have to specify the full path.
我以此为例,您可以使用更实际的内容(例如位于C:\Program Files\Java\{JDK_VERSION}\bin
的JDK bin目录中)替换文件夹,以执行javac
,keytool
或所需的所有内容.
I used this as an example, you can replace the folder with something more realistic like the JDK bin directory located here C:\Program Files\Java\{JDK_VERSION}\bin
to execute javac
, keytool
or everything you want.
步骤1 -单击
Windows
图标
步骤2 -单击
Settings
图标
第3步-单击
System
步骤4 -单击
About
步骤5 -单击
System info
步骤6 -单击
Advanced system settings
步骤7 -单击
Environment variables...
步骤8 -选择
Path
行,然后单击Edit
Step 8 - Select
Path
row and then clickEdit
步骤9 -单击
New
,然后单击Browse
,然后在将打开的下一个面板中,您需要在Path
中选择所需的文件夹.作为本指南的初始前提,我将添加文件夹C:\Users\NewFolderInPath
Step 9 - Click
New
and then clickBrowse
, then in the next panel which will open you need to select the folder you want in thePath
. For the initial premise of this guide i will add the folderC:\Users\NewFolderInPath
步骤10 -单击
OK
,然后单击将遇到的每个OK
按钮,以关闭以前的每个窗口.
Step 10 - Click
OK
and click everyOK
button you will encounter to close every previous windows.
步骤11 -打开
command prompt (cmd)
,现在您无需指定完整路径即可执行实用程序.
Step 11 - Open a
command prompt (cmd)
and now you can execute your utility without specifying the full path.
注意:对于每个问题,请在下面留下评论,我会尽快答复. 祝你好运,编码愉快:)
NOTE : For every problems leave a comment below and i will answer as soon as i can. Good luck and happy coding :)
这篇关于如何在Windows 10中将文件夹添加到`Path`环境变量中(带有屏幕截图)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!