如何在Windows 10中将文件夹添加到`Path`环境变量中(带有屏幕截图) [英] How to add a folder to `Path` environment variable in Windows 10 (with screenshots)

查看:713
本文介绍了如何在Windows 10中将文件夹添加到`Path`环境变量中(带有屏幕截图)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在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目录中)替换文件夹,以执行javackeytool或所需的所有内容.

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 click Edit

步骤9 -单击New,然后单击Browse,然后在将打开的下一个面板中,您需要在Path中选择所需的文件夹.作为本指南的初始前提,我将添加文件夹C:\Users\NewFolderInPath

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:\Users\NewFolderInPath

步骤10 -单击OK,然后单击将遇到的每个OK按钮,以关闭以前的每个窗口.

Step 10 - Click OK and click every OK 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆