Sublime Forum

Using Sublime from Windows 8.1 Command Line

#1

I can’t seem to get subl. exe working on my laptop.
I have found the correct folder that it is in, I have added it to a system variable and I have also added it to the Path. I can’t seem to find a PATH in all capital letters. I have taken some screenshot of what I have done. When I run cmd line nothing happens. I would really appreciate some help.

0 Likes

#2

You need to create the system variable called SUBLIME pointing to the folder where your subl.exe file is on. After that restart your computer to the change take effect.

1 Like

#3

I have done that which is C:\Program Files\Sublime Text 3 and put it under a system variable called SUBLIME. I reset my computer and run command line as Admin and it is still not working.

0 Likes

#4
  1. If you open the cmd and type C:\Program Files\Sublime Text 3\subl does it open Sublime Text?
  2. Try to directly put C:\Program Files\Sublime Text 3\; instead of creating a variable called SUBLIME on the Path variable.
1 Like

#5

I have Windows 8.1. I have Sublime Text on my task bar. One click and it launches. It was simple to set up and simple to launch. Simple rocks! I try to avoid typing as much as possible. :grinning:

0 Likes

#6

Thank you so much addons_zz it is working now. :smiley:

0 Likes

#7

Actually it only works if I use C:\Program Files\Sublime Text 3\subl.exe and it stays open. As soon as I close sublime I cannot open it using command line. This is what I have put into the path and it still doesn’t work.

0 Likes

#8

Perhaps you shouldn’t use the trailing semi-colon.

0 Likes

#9

I tried it with and without and it still doesn’t work.

0 Likes

#10
  1. Did you restarted the computer each time you changed the value?

  2. If you open the prompt of command cmd.exe and type

    subl.exe

    does it open Sublime Text?

0 Likes

#11

Yes I have restarted the computer everytime I’ve changed the system variable. I typed cmd. exe then subl.exe and nothing happened.

0 Likes

#12

When you say “nothing happened”, do you mean:

  1. Literally nothing; pressing enter brings back the command prompt with nothing displayed, but also no Sublime window appears at all.
  2. An error message like 'subl' is not recognized as an internal or external command, operable program or batch file appears and the prompt comes back
  3. Something else?

If the answer is #1, then the path is set correctly but there is something else interfering with things. If it’s #2 then the path is still not correct, so I would double check that it’s what you think it is.

In the case of #1, note that when starting Sublime through the command prompt it just talks to an existing running instance to tell it to create a new window, or starts Sublime running if it’s not already. So if running it displays no errors but seems to have no effect, it may be because the process is running already and you just can’t see it (e.g. it’s on some other desktop than you think it is, or it’s still running but not visible because it hung while terminating, etc).

So you may want to check in task manager (I assume Windows 8 has such a thing) to see if there is a Sublime running when you try this and it fails.

2 Likes

#13

It’s number 1. I’ve checked task manager and sublime is not running. I’ll just have to open it like this in the command line:“C:\Program Files\Sublime Text 3\subl.exe” to open subl
then go to the folder that I want a sublime file to be in.
Thanks for your help.

0 Likes

#14

Very weird indeed. What about trying sublime_text from the command line instead of subl; does that work?

I’ve never used Windows 8 so I don’t know if there may be something specific to that particular OS that’s stopping it from working as expected aside from what I’m familiar with in Windows 7/10, unfortunately.

0 Likes

#15

Using sublime_text worked. I think I might consider windows 10 when I have the money. This has been really weird and I’m not sure why the subl command doesn’t work. Thank you for your help.

2 Likes

#16

Although I don’t usually do this, preferring instead to use a Task Bar icon, when I added to the Path in Windows 8.1, subl worked perfectly from the command line. I used a path editor.

1 Like