4

I am using Windows as my Operating System.

My drive(f:) folders look like this:

f:/
----> myproject/
--------> db.sqlite3
--------> manage.py
--------> db.sqlite3

I want to open my myproject folder with SublimeText3 in cmd in Windows.

In cmd I navigate to my project directory (F:\my project) and enter this command:

subl .

I get this result:

'subl' is not recognized as an internal or external command,
 operable program or batch file.

What should I do?

jwpfox
  • 5,124
  • 11
  • 45
  • 42
  • 1
    Possible duplicate of [What is the reason for '...' is not recognized as an internal or external command, operable program or batch file?](https://stackoverflow.com/questions/41454769/what-is-the-reason-for-is-not-recognized-as-an-internal-or-external-comman) – Mofi Sep 12 '17 at 10:02

2 Answers2

6

You need to add subl as an Environment variable so that cmd can find the program.

Go to Control Panel\System and Security\System and click "Advanced system settings". Go to the "Advanced" tab and click on "Environment Variables...". Add the directory containing subl.exe to the end of the Path variable in "System variables", e.g.

;C:\Program Files\Sublime Text 3

The semicolon separates the values in the Path variable, so don't forget to add it.

Restart your command line, and you should be able to use subl.

James McAuliffe
  • 138
  • 1
  • 9
  • I was troubleshooting this for a little bit and this is the only post I saw mention the semicolon. Lo and behold it was fixed. This should be higher – Alec May 26 '21 at 23:10
2

So your System does not know where to find subl

You need to tell it where it is. So find where the executable is.

Then Right click Computer -> Properties -> Advanced System Settings -> Environment Variables then add the Path of where the file exits into PATH by using semicolon to separate it from the previous path.

for instance C:\Program Files\Sublime Text 3\

Alternatively, run the full path each time to subl in your scripts.

Gerhard
  • 22,678
  • 7
  • 27
  • 43