garethflowers / vscode-portable

Portable version of the Visual Studio Code editor.
https://garethflowers.dev/vscode-portable/
GNU General Public License v2.0
512 stars 71 forks source link

Renaming the executable #41

Open asunar opened 6 years ago

asunar commented 6 years ago

I would like to start portable VS Code from the command line. For example I would like to start it with

code .

Renaming the exe to code caused an exception. Any ideas?

nidunc commented 6 years ago

Renaming the exe to code caused an exception. Any ideas?

Do you mean that you tried to rename Code.exe to just Code? I can see why that didn't work, Visual Studio Code probably depends on the main executable being called Code.exe.

There is one, albeit non-portable, way to achieve what you want (if I understood you correctly) - provided you have administrator access to the computer you're running VSCode on.

  1. Go to the system environment variables
  2. Add the directory which contains Code.exe to the PATH variable (see linked article for instructions)
  3. Now you can type code in any command prompt (on the same computer) to start Visual Studio Code

Of course you should rename code back to Code.exe before actually trying to start VSCode this way.


Disclaimer: I'm not the maintainer of this repository, but a mere contributor.

asunar commented 6 years ago

Does it work for you when change the name of the exe to code.exe? Yes, I meant I tried to rename it to code.exe.

nidunc commented 6 years ago

Do you mean you tried to rename the executable from Code.exe (with a capital C) to code.exe (all lower case letters)?