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

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

问题描述

在 StackOverflow 和一般网络上,关于如何将特定文件夹添加到用户的 Windows 10 Path 环境变量的指南已过时且很少.

我认为为新开发人员提供的完整指南以及分步说明和屏幕截图对于帮助他们从

<块引用>

第 2 步 - 点击 Settings 图标

<块引用>

第三步 - 点击系统

<块引用>

第四步 - 点击About

<块引用>

第五步 - 点击系统信息

<块引用>

第 6 步 - 点击高级系统设置

<块引用>

第 7 步 - 点击环境变量...

<块引用>

第 8 步 - 选择 Path 行,然后点击 Edit

<块引用>

第 9 步 - 点击 New,然后点击 Browse,然后在下一个打开的面板中,您需要选择所需的文件夹在 路径 中.对于本指南的初始前提,我将添加文件夹 C:UsersNewFolderInPath

<块引用>

第 10 步 - 单击 OK 并单击您将遇到的每个 OK 按钮以关闭之前的所有窗口.

<块引用>

第 11 步 - 打开 命令提示符 (cmd),现在您无需指定完整路径即可执行实用程序.

注意:对于每个问题,请在下方留言,我会尽快回复.祝你好运,编码愉快:)

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.

解决方案

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

Step 2 - Click on the Settings icon

Step 3 - Click on System

Step 4 - Click on About

Step 5 - Click on System info

Step 6 - Click on Advanced system settings

Step 7 - Click on Environment variables...

Step 8 - Select Path row and then click Edit

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

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

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天全站免登陆