open-sublime-text-from-windows-cmd-command-line

Open Sublime Text from Windows Command Line (CMD) and Power Shell

This tutorial will help you set Sublime Text 3 on Windows Systems up, to launch Sublime text 3 from Windows Command Line – CMD or Windows Power Shell with subl command.

Create a User variable – subl

To create a new user variable on your system, click Windows menu button and look for “variable” and click the following option otherwise you can go to system’s variables from control panel as well.

system-variables

Perfect, now click the environment varialbes.

advanced system variables

Let’s create a new user variable by clicking new button from the upper section.

Locate the sublime text exe file path on your system. This is how it is on my Windows 10 64 bit system. Copy it.

C:\Program Files\Sublime Text 3\sublime_text.exe

Create a New User Variable

Now, launch System Environment Variables windows and create a new user variable to launch sublime text with from CMD or PowerShell. Give it a name, I have given subl and paste the Sublime text 3 exe file path in the variable value field and click OK.

 Create a User variable - subl

Add Sublime Text to System Variable Path

Select path from either top User Variables or bottom system variable and then click edit.

env-variable-path

To add Sublime text to the environment variable, copy the Sublime Text 3 directory and click NEW on right top and paste the Sublime Text 3 directory. and click ok*3 …

 Add Sublime Text to System Variable Path

Again just copy the Sublime Text directory path, and create a new ENV variable path.

Open Sublime Text with Windows command line CMD or Power Shell

Finally, relaunch your power shell or cmd or command line interface and locate to folder or directory that you want to open with sublime text and type subl .

.” means open the current directory with sublime text, so don’t forget to add dot sign when you want to open any particular folder with subl

C:\Users\TubeMint>subl .

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.