A
A
Alexey Kartushin2016-08-27 15:40:32
terminal emulator
Alexey Kartushin, 2016-08-27 15:40:32

How to create an additional Windows console command?

How to create an additional command in the console?
For example, in Ubuntu, I can write subl before the file and the file will automatically open in the sublime text, how can I do the same in the Windows console?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Alexey Yarkov, 2016-08-27
@Alovinglol

But what about)) Add the path to the sublime folder to the PATH environment variable and it will also work: subl path\to\file.txt
https://scotch.io/tutorials/open-sublime-text-from...

S
Sasha Chernykh, 2016-08-27
@Kristinita

You asked 2 different questions in one. Please don't do this again .
Windows has a doskey command , but since you've been working on Ubuntu, I think you'll be more comfortable using the Cash program, which adds many UNIX-like OS commands to Windows. I wrote a small overview of Cash in this answer .
After installation, the command will be available alias: create aliases in the same way as in Ubuntu. The simplest example:

E:\Киролайна>cash
[email protected]:E/Киролайна$ alias amazing='echo Sasha_Amazing!'
[email protected]:E/Киролайна$ amazing
Sasha_Amazing!

If you are using Sublime Text 2 or earlier versions of Sublime Text 3, enter the command mentioned earlier in the terminal doskey:
doskey subl="C:\Program Files\Sublime Text 2\sublime_text.exe" $*
, where C:\Program Files\Sublime Text 2\sublime_text.exe is the path to your Sublime Text executable.
When Sublime Text 3 Build 3065 or higher is installed, copy the subl.exe file from the Sublime Text 3 installation folder to C:\Windows\System32 . That's it, the new team should earn subl. To open the SashaSaviora.txt file in Sublime Text 3, just enter subl SashaSaviora.txt.
The sixth chapter of the Sublime Text Power User book - "Terminal and Command Line Integration" is devoted to the integration of Sublime Text with the command line. It starts on page 48 . True, in this chapter I noticed 2 errors, which I wrote about here under numbers 50 and 52.
Thank you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question