0

In my project's directory structure, the shell, mingw32.exe is located at path /dir1/dir2/dir3 and my Makefile located at /dir1/.

So first I have to go to the path /dir1/dir2/dir3, open\run\click the mingw32.exe. Now here shell opened with default path like home/username. So now i have to go to the path where my makefile is located (at /dir1) to compile the source code. Now my expectation mingw32.exe shell should open with path /dir1.

For that purpose I have created a batch file at path where my Makefile located (at /dir1) like below:

@echo off

:generate
call dir1\dir2\dir3\mingw32.exe
  • shell path : dir1/dir2/dir3/mingw32.exe
  • Makefile path : dir1/Makefile
  • batch file path : dir1/test.bat

Using this batch file, the problem of navigating to the mingw32.exe path is solved. But the second issue still remains, mingw32.exe opens with default path, i.e. home/username, but it should be open with current working directory (/dir1)

Anyone have idea about how can i achieve this?

user2520119
  • 183
  • 10
  • Unclear what you are asking, but I'm guessing you want to `cd` to a specific directory in your batch file before the `call`. You will need to update the relative path to the exe, or simply put an absolute path instead. Maybe see also https://stackoverflow.com/a/55342466/874188 – tripleee Oct 22 '19 at 07:53
  • @tripleee i have edited the question, hope this time it will be clear. – user2520119 Oct 22 '19 at 09:13
  • 1
    Possible duplicate of [changing mingw' startup directory or creating mingw symlinks](https://stackoverflow.com/questions/7000524/changing-mingw-startup-directory-or-creating-mingw-symlinks) – John Bollinger Oct 22 '19 at 11:59

0 Answers0