Configure Intellij IDEA to run batch file

Also if you install "Batch Scripts Support" plugin, you will get nice file context menu actions for running batch files directly from the project view.

NOTE 2019: The original authors abandoned the plugin, but there is a maintained fork for current versions of IntelliJ: https://github.com/SimonIT/idea-batch

NOTE 2020: Even newer fork is: https://github.com/aefimov/idea-batch

Context menu


You can use "External Tools" to invoke any program

Goto Settings->External Tools and create a tool which will open the following dialog choose the batch file for Program.

Create Tool Dialog

Then the tool will be available in the menu Tools

Tools Menu

Ref:External Tools

Update:

If you want to link an 'External Tool' to a 'Button' in the toolbar check How to add buttons linked to your external tool in InteliJ IDEA


Another alternative to IntelliJ 2019 is:

Edit Configuration > Click '+' > Select Shell Script > 'In Script path:' set the .bat file location > OK > Click play button or Run once you have saved it

See image below: enter image description here