How to open a file from CLI using a text editor of my choice, if the name of application has multiple strings?

5.2k Views Asked by At

Im learning to use hyper terminal for my web development. I need to open a file directly from CLI using VSCode. For opening it using notepad++ i can open it by writing

start Notepad++ filename.ext

But i want to open it with Visual studio code.For which i wrote

start Visual studio Code filename.ext

The name of vscode is shown as Visual studio Code in apps. Since it has multiple strings im getting error. how do i bind the name of application together. Incase if i want to open through atom i write,it works fine.

start Atom filename.ext 

How do i make it work.

3

There are 3 best solutions below

0
jrima12 On BEST ANSWER

I believe to open Visual studio code through the terminal you need to call it as 'code', so in your case it would be "start code filename.ext". Be advised I am working in linux, it may be slightly different in windows. You can also look at the properties of vscode and it should say there how to open it.

0
Necrobit On

I know this is a late answer, but maybe it will help others. The command is: code filename.txt

1
Obinna Edmund On

To open Visual Studio code from your Hyper Terminal, just type: code .