Skip to main content

Create a new batch/cmd file called "vscode.cmd", insert the following command then save it to the "C:\Windows\System32" folder.

@echo off

::
:: Installing: Create a new batch/cmd file called "vscode.cmd", insert erything
:: below this comment block and save it to the "C:\Windows\System32" (32-bit),
:: or "C:\Windows\SysWOW64" (64-bit) folder.
::

REM Usage: vscode [options][paths...]
REM
REM To read output from another program, append '-' (e.g. 'echo Hello World | code.exe -')
REM
REM Options
REM   -d --diff <file> <file>           Compare two files with each other.
REM   -a --add <folder>                 Add folder(s) to the last active window.
REM   -g --goto <file:line[:character]> Open a file at the path on the specified
REM                                     line and character position.
REM   -n --new-window                   Force to open a new window.
REM   -r --reuse-window                 Force to open a file or folder in an
REM                                     already opened window.
REM   -w --wait                         Wait for the files to be closed before
REM                                     returning.
REM   --locale <locale>                 The locale to use (e.g. en-US or zh-TW).
REM   --user-data-dir <dir>             Specifies the directory that user data is
REM                                     kept in. Can be used to open multiple
REM                                     distinct instances of Code.
REM   -h --help                         Print usage.
REM
REM Extensions Management
REM   --extensions-dir <dir>
REM       Set the root path for extensions.
REM   --list-extensions
REM       List the installed extensions.
REM   --show-versions
REM       Show versions of installed extensions, when using --list-extension.
REM   --category
REM       Filters installed extensions by provided category, when using --list-extension.
REM   --install-extension <extension-id[@version] | path-to-vsix>
REM       Installs or updates the extension. The identifier of an extension is always `${publisher}.${name}`. Use `--force` argument to update to latest version. To install a specific version provide `@${version}`. For example: 'vscode.csharp@1.2.3'.
REM   --uninstall-extension <extension-id>
REM       Uninstalls an extension.
REM   --enable-proposed-api <extension-id>
REM       Enables proposed API features for extensions. Can receive one or more extension IDs to enable individually.
REM
REM Troubleshooting
REM   -v --version                       Print version.
REM   --verbose                          Print verbose output (implies --wait).
REM   --log <level>                      Log level to use. Default is 'info'.
REM                                      Allowed values are 'critical', 'error',
REM                                      'warn', 'info', 'debug', 'trace', 'off'.
REM   -s --status                        Print process usage and diagnostics
REM                                      information.
REM   --prof-startup                     Run CPU profiler during startup
REM   --disable-extensions               Disable all installed extensions.
REM   --disable-extension <extension-id> Disable an extension.
REM   --sync <on> <off>                  Turn sync on or off
REM   --inspect-extensions <port>        Allow debugging and profiling of
REM                                      extensions. Check the developer tools for
REM                                      the connection URI.
REM   --inspect-brk-extensions <port>    Allow debugging and profiling of
REM                                      extensions with the extension host being
REM                                      paused after start. Check the developer
REM                                      tools for the connection URI.
REM   --disable-gpu                      Disable GPU hardware acceleration.
REM   --max-memory                       Max memory size for a window (in Mbytes).
REM   --telemetry                        Shows all telemetry events which VS code
REM                                      collects.

REM Launch Visual Studio Code from the command line:
CALL "%LOCALAPPDATA%\Programs\Microsoft VS Code\bin\code.cmd" %*