0

I want to create a new Run/Debug Configuration which executes a .bat file that accepts a Python script as a parameter.

The program I want to execute is MonkeyRunner (a tool part of Android SDK) which is located in the C:\Users\talha\AppData\Local\Android\Sdk\tools\bin folder. And my PyCharm project is located in C:\Users\talha\Documents\PyCharmProjects folder.

talha06
  • 6,206
  • 21
  • 92
  • 147
  • I think the easiest way to do this is going to be pyhton shim that calls the bat file with whatever argument is being passed to it. – Shadow Sep 05 '18 at 03:07
  • Is it has to be a Run/Debug Configuration? Maybe [External Tools](https://confluence.jetbrains.com/display/PhpStorm/Running+External+Tools+in+PhpStorm) will do? But if it has to be a Run/Debug Configuration ... have a look at [CMD Support plugin](https://plugins.jetbrains.com/plugin/5834-cmd-support) and see if it can do that. Other than that .. maybe you can run it using some another way (e.g. create a task in your task runner that IDE supports -- e.g. Npm/Gulp/Grunt/etc) – LazyOne Sep 05 '18 at 12:12
  • 'External tools' utility does the work. If you post this comment as an answer, I will be able to accept as the answer of the question. Thanks. @LazyOne – talha06 Sep 05 '18 at 17:14

2 Answers2

0

Instead of manually navigating in Explorer -- just use "Navigate | Select in... | Explorer (Alt+F1, 8)" on such bat file and IDE will open Explorer with that file already selected https://intellij-support.jetbrains.com/hc/en-us/community/posts/207057025-Can-I-run-a-batch-file-bat-from-within-the-IDE-

0

There's a free plugin on the JetBrains marketplace that provides:

Windows Batch Scripts support for IntelliJ IDEA. Supports syntax highlighting, run configurations that can run any command, also empty configurations. Empty run configurations are useful when you want to execute an external tool through a run configuration.

Mathieu Dhondt
  • 8,405
  • 5
  • 37
  • 58