1

I'm developing lot of small .esb services recently and I'm pretty tired of doing Shift+Right click to open cmdin current directory then typing mvn clean install.

What is the easiest way to run simple .bat file like:

cleanInstall.bat:

mvn clean install

on current directory when user will press a some simple shortcut e.g.: Win+C?

I have already read this thread: How can I open a command prompt in current folder with a keyboard shortcut? However I'm wondering do I need to use 3rd party software?

I'm using Windows 7 Polish version.

1 Answers1

0
  1. Edit your batch file to cd /D "%1" before running mvn.

  2. In the answer to the question you linked, change the lines at the bottom so that Run, cmd /K cd /D "%full_path%" is replaced with Run, mvnCleanInstall.bat "%full_path%" (or whatever your batch file is called).

  3. Install autohotkey and the modified script per the comments to the answer.

  4. Enjoy!

(Edited-original answer below)

Other options: Classic Shell will let you create toolbar buttons in Explorer windows that run programs in the directory that window is showing.

Alternatively, you could create a shortcut to your bat file and name the shortcut "c" or something else short. Then you could type c in the address bar of an Explorer window and hit Enter to run the bat in the open folder. (Source)

cxw
  • 1,739