0

I'm trying to run a batch file in Eclipse (with the end goal of making it into a Run As Configuration), but when I double click the batch file in Eclipse, instead of populating the correct directory with files (that are specified in the batch files), it populates the place I installed Eclipse in. Now, this is all well and good, but eclipse has a default folder named plugins, and the batch file also needs to use a folder named plugins. I cannot rename either folder, as both programs will break. I wonder if there is a way to make batch files run in their default location, instead of transporting them to some other directory.

  • 1
    I do not know if I understood your question, but maybe you only have to create a _External Tool Configuration_ and specify the _Working Directory_: https://stackoverflow.com/a/1090379/6505250 – howlger Jul 30 '17 at 21:02
  • @howlger This worked for me. Please post your comment as an answer and I will accept it. –  Aug 24 '17 at 23:48

1 Answers1

0

You could create an External Tools Configuration and specify the working directory:

  1. Run > External Tools > External Tools Configuration...
  2. Select the Program node and click the New launch configuration button
  3. Enter the location of your batch file in the field Location
  4. Specify the working directory in the field Working Directory
  5. Click Run to save the configuration and execute it

To rerun your batch file click the Launch external tool button in the main toolbar.

To edit the batch file (and change the double-click behavior for this file) right-click the batch file and choose Open With > Text Editor.

howlger
  • 31,050
  • 11
  • 59
  • 99