Home > Mobile >  How can I use "open as" with commands on shell?
How can I use "open as" with commands on shell?

Time:09-13

I've created a folder named my-express-server, I want to open it with visual studio code directly from the shell. So I found this command start [name of the file] -a [the program path I want to open my file with].

CodePudding user response:

The way windows treats file extensions has led many people to believe that it is the extension that determines which program is used to open files.

In command line contexts, there is not really an "open as" command, as you ask. Instead, you choose the tool you want to process the file with explicitly.

In your case, you would choose the tool that you want to use, i.e. Visual Studio Code, so you would use the code command. Then you choose the file/directory you want to open.

For example, if you want to open the file server.js, you would run code server.js.

  • Related