I need to create a new "shortcut" command in Sublime Text to run a BAT file.

I know how to use build_systems and even build_systems per project.

I want to add the command to the command palette list (in the image), and to bind a hot-key for that.

enter image description here

How do I do that?

(I'd prefer not using Python for this)

  • 1
    Have you looked at this already?
    – danicotra
    Aug 16, 2015 at 18:43
  • Glad having been of help... I'm still considering if making that suggestion as an answer...
    – danicotra
    Aug 16, 2015 at 19:09
  • You cannot add asnwer just a link, so add a link, short explain, and example of JSON file. You will get my "accepted answer" :) Aug 16, 2015 at 19:34
  • I can't test it by myself in this precise moment, anyway supposing you had no difficulty in installing the package, the JSON should then be the following: { "caption": "Launch Batch File", "command": "open_file", "args": { "file": "path_to_your_file/filename.bat" } } change caption if you wish + file-path and file-name as needed.
    – danicotra
    Aug 16, 2015 at 21:15
  • 1
    P.S. : are you using Windows? If so, supposing your batch file is named "test.bat" and you have it in "D:\myfolder\test.bat" then use "file": "/D/myfolder/test.bat"
    – danicotra
    Aug 16, 2015 at 21:47

2 Answers 2


Here is my answer for this:

The steps to follow

  • Install edit-command-palette plugin for Sublime Text (it is easy, so I won't describe how);
  • Edit the command file: from menu "Preferences" select "Command - User";
  • Edit the key bindings file to add hotkeys: menu "Preferences" select "Key Bindings - User".

The command file (second step):

        "caption": "moyshale",
        "args": {"cmd": "c:\\drive\\1file\\cp.bat"}

Adding a hot-key (third step):

"keys": ["ctrl+shift+y"],
        "args": {"cmd": "c:\\drive\\1file\\cp.bat"}

(It's basically the same, just needs to change keys and caption)


i'm use build new system like this definition

    "cmd": ["c:/yourpythonpath/python.exe", "-u", "$file"],
    "file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
    "selector": "source.python",

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.