1

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.

Cr5
  • 13
  • 1
  • 3
  • Probably use single quotes: `start 'Visual studio Code' filename.ext`. –  Aug 07 '20 at 14:52
  • I tried, but it dint work... start code fname.ext worked...Thanks for ur response... – Cr5 Aug 08 '20 at 16:13
  • 1
    The name of the program, as shown in Windows Explorer, is irrelevant. When you launch a program, ultimately you need to know its main binary, which in Visual Studio Code is `code.exe`. Your other examples, the commercial name happens to be the same as the exe name. You can look up this by looking at your shortcuts for the command to run. A similar thing would happen with Microsoft Word for example, whose binary is really `winword.exe`. – Alejandro Jun 09 '21 at 18:34

3 Answers3

2

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.

jrima12
  • 50
  • 8
2

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

Necrobit
  • 21
  • 4
-1

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