在 Windows 上哪里可以设置 make.exe 的路径?
当我尝试在 Windows 上从 cmd 控制台运行 make
时,它运行 Turbo Delphi 的 make.exe
但我需要 MSYS 的 make.exe
。 %path%
变量中没有提及 Turbo Delphi,也许我可以在注册表中将其更改为 MSYS?
When I try run make
from cmd-console on Windows, it runs Turbo Delphi's make.exe
but I need MSYS's make.exe
. There is no mention about Turbo Delphi in %path%
variable, maybe I can change it to MSYS in registry?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
该路径位于注册表中,但通常您可以通过此界面进行编辑:
控制面板
->系统
->系统设置
->环境变量
。PATH
。c:\path;c:\path2
The path is in the registry but usually you edit through this interface:
Control Panel
->System
->System settings
->Environment Variables
.PATH
.c:\path;c:\path2
在这里,我为初学者提供在 Windows 中设置 Terraform 环境变量的解决方案。
复制此路径位置,例如 C:\Apps\terraform\
Control Panel ->系统->系统设置->环境变量
在
系统变量
中,选择Path
>编辑
>新
>输入 Terraform .exe 的位置,例如C:\Apps\Terraform
,然后单击确定
Here I'm providing solution to setup Terraform environment variable in windows for beginners.
copy this path location like C:\Apps\terraform\
Control Panel -> System -> System settings -> Environment Variables
In
System Variables
, selectPath
>edit
>new
> Enter the location of the Terraform .exe, egC:\Apps\Terraform
then clickOK
或者您可以运行此 PowerShell 命令将额外的文件夹附加到现有路径:
Or you can just run this PowerShell command to append extra folder to the existing path:
要添加 PERSISTENT 路径(例如永久路径),您可以在 PowerShell 中执行此操作(调整最后的 c:\apps\terraform 部分)。
或者,您可以通过 RUNning/CMD/PowerShell 直接跳转到“环境变量”对话框这个:
To add a PERSISTENT path (eg one that's permanent), you can do this one-liner in PowerShell (adjust the last c:\apps\terraform part)
Alternatively, you can jump directly to the Environment Variables dialog by RUNning/CMD/PowerShell this:
我有一段时间遇到问题,除非我位于 exe 目录中,否则即使我正确设置了路径,也无法运行 Terraform 命令。
对于发现此问题的其他人,我通过将环境变量移至比其他人更高的位置来修复它!
I had issues for a whilst not getting Terraform commands to run unless I was in the directory of the exe, even though I set the path correctly.
For anyone else finding this issue, I fixed it by moving the environment variable higher than others!
为什么不创建一个包含以下行的 bat 文件
makedos.bat
?并将其放入
C:\DOS
(或C:\Windows
è 或确保它位于您的%path%
中)您可以从 cmd、SET 运行,它会显示所有环境变量,包括 PATH。
在注册表中,您可以在以下位置找到环境变量:
HKEY_CURRENT_USER\Environment
HKEY_CURRENT_USER\Volatile Environment
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment
Why don't you create a bat file
makedos.bat
containing the following line?and put it in
C:\DOS
(orC:\Windows
è or make sure that it is in your%path%
)You can run from cmd, SET and it displays all environment variables, including PATH.
In registry you can find environment variables under:
HKEY_CURRENT_USER\Environment
HKEY_CURRENT_USER\Volatile Environment
HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Session Manager\Environment
如果名称冲突,只需将其复制到 system32 调用 make1 或其他名称即可。
just copy it to system32 call make1 or whatever if the name conflicts.