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?
-
This question should be re-written to be more high-level eg "how to append/update path environment variable on Windows", since the question is specific to a particular .exe file. – KERR Jun 17 '21 at 12:54
7 Answers
The path is in the registry but usually you edit through this interface:
- Go to
Control Panel
->System
->System settings
->Environment Variables
. - Scroll down in system variables until you find
PATH
. - Click edit and change accordingly.
- BE SURE to include a semicolon at the end of the previous as that is the delimiter, i.e.
c:\path;c:\path2
- Launch a new console for the settings to take effect.

- 1,841
- 22
- 27
-
no effect, still Borlans's make.exe runs. I think it must be in registry, because >>There is no mention about Turbo Delphi in %path% variable – d9k Oct 24 '09 at 15:40
-
OK, when I tried "echo %path%" I saw Turbo Delphi's path in the middle of the long string. Thank you and sorry for inattention. – d9k Oct 24 '09 at 15:48
-
4Windows 10 has a few ways of arriving there now, and includes a new GUI for managing entries so you don't need to remember that pesky semi-colon anymore: http://superuser.com/questions/949560/how-do-i-set-system-environment-variables-in-windows-10 – Mike Branski Nov 28 '15 at 05:11
-
Use the Windows command "where" to find out where make.exe lives. For example: "where make.exe" Gives this result on my computer: C:\Program Files (x86)\Borland\Delphi7\Bin\make.exe If I had make.exe in other paths, it would show those. – mxmoss Sep 18 '18 at 15:45
-
1It would be easier to RUN or CMD/PowerShell to: rundll32.exe sysdm.cpl,EditEnvironmentVariables This future-proofs it as MS keeps fiddling with the GUI. – KERR Jun 17 '21 at 11:03
-
2OMG :) Microsoft using this page as a part of documentation and guiding . https://learn.microsoft.com/en-us/azure/developer/terraform/get-started-windows-bash?tabs=bash – user8231110 Nov 17 '21 at 12:09
-
Here I'm providing solution to setup Terraform environment variable in windows for beginners.
- Download the terraform ZIP file from Terraform site.
- Extract the .exe from the ZIP file to a folder eg C:\Apps\Terraform copy this path location like C:\Apps\terraform\
- Add the folder location to your PATH variable, eg:
Control Panel -> System -> System settings -> Environment Variables
In System Variables
, select Path
> edit
> new
> Enter the location of the Terraform .exe, eg C:\Apps\Terraform
then click OK
- Open a new CMD/PowerShell and the Terraform command should work

- 1,312
- 18
- 13

- 537
- 4
- 3
-
7
-
Hello @MarkRotteveel, I hve not asked question here, just I provided how to setup enviroment varible for terraform in windows – 24x7Cloud Services May 03 '19 at 10:05
-
1The question is about running MSYS make.exe from the windows command prompt. That has nothing to to with terraform. Your answer doesn't belong here. – Mark Rotteveel May 03 '19 at 10:15
-
6@MarkRotteveel agree but the 'mistake' is being fed from https://learn.hashicorp.com/terraform/getting-started/install – Jul 01 '19 at 10:52
-
4@MattBracewell Nothing in the question suggests that has anything to do with it, and Terraform didn't even exist when this question was asked back in 2009. – Mark Rotteveel Jul 02 '19 at 15:39
-
Or you can just run this PowerShell command to append extra folder to the existing path:
$env:Path += ";C:\temp\terraform"

- 4,555
- 31
- 31
- 45

- 121
- 1
- 2
-
2Powershell would not detect my environmentVar changes until i ran this powershell command, thank you – JrBriones Aug 26 '20 at 16:10
-
As far as I can tell this is only temporary - I added an answer to fix that. – KERR Jun 17 '21 at 10:58
-
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)
Set-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH -Value (((Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).path) + ";c:\apps\terraform" )
Alternatively, you can jump directly to the Environment Variables dialog by RUNning/CMD/PowerShell this:
rundll32.exe sysdm.cpl,EditEnvironmentVariables

- 1,312
- 18
- 13
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!

- 11
- 1
-
I tried but no use still unable to find terraform commands. Any other suggestions can you provide? – subhashis Oct 01 '22 at 12:30
-
My issue was: I was adding the full path of the exe file. You must ONLY add the directory path. NOT the 'terraform' at the end. – Arindam Roychowdhury Jan 10 '23 at 15:21
Why don't you create a bat file makedos.bat
containing the following line?
c:\DOS\make.exe %1 %2 %5
and put it in C:\DOS
(or C:\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

- 9,608
- 6
- 34
- 56

- 1,454
- 8
- 34
- 60
just copy it to system32 call make1 or whatever if the name conflicts.
-
Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Dec 29 '22 at 21:05