|
| 1 | +--- |
| 2 | +title: "Introducing vscwhere!" |
| 3 | +date: "2026-01-08T12:00:00-05:00" |
| 4 | +categories: [rust, cli, vscode] |
| 5 | +description: "A CLI tool for locating Visual Studio Code installations on Windows, inspired by Microsoft's vswhere" |
| 6 | +--- |
| 7 | + |
| 8 | +If you've ever used Microsoft's [vswhere](https://github.com/microsoft/vswhere), you know how handy it is. Need to find where Visual Studio is installed? Run `vswhere`. Need the path for a CI/CD script? `vswhere -latest -property installationPath`. It just works. |
| 9 | + |
| 10 | +But what if you need to find Visual Studio *Code* instead? |
| 11 | + |
| 12 | +So I built it. |
| 13 | + |
| 14 | +## Introducing vscwhere |
| 15 | + |
| 16 | +**vscwhere** is a CLI tool that locates Visual Studio Code installations on Windows. Think of it as vswhere's little sibling — same idea, same familiar interface, just for VS Code instead of Visual Studio. |
| 17 | + |
| 18 | +Need to find all your VS Code installations? Just run: |
| 19 | + |
| 20 | +```bash |
| 21 | +vscwhere |
| 22 | +``` |
| 23 | + |
| 24 | +That's it. You'll get a list of all the VS Code installations on your machine — Stable and Insiders builds alike. |
| 25 | + |
| 26 | +## The Options |
| 27 | + |
| 28 | +If you're familiar with vswhere, you'll feel right at home: |
| 29 | + |
| 30 | +``` |
| 31 | +Options: |
| 32 | + -all Find all instances (default) |
| 33 | + -prerelease Include prerelease (Insiders) builds |
| 34 | + -latest Return only the latest version |
| 35 | + -format <type> Output format: text (default), json |
| 36 | + -property <name> Return value of specified property |
| 37 | + -nologo Suppress version banner |
| 38 | + -sort Sort instances by version (descending) |
| 39 | + -help, -? Display this help message |
| 40 | +``` |
| 41 | + |
| 42 | +Need JSON for your build scripts? `-format json`. Just want the latest stable version's path? `-latest -property installationPath`. Need to include Insiders builds? `-prerelease`. |
| 43 | + |
| 44 | +## Example Output |
| 45 | + |
| 46 | +Here's what it looks like in action. Running `vscwhere` with no arguments: |
| 47 | + |
| 48 | +``` |
| 49 | +> vscwhere |
| 50 | +VSCWhere version 0.1.0 |
| 51 | +
|
| 52 | +installationPath: C:\Users\calvin.allen\AppData\Local\Programs\Microsoft VS Code\ |
| 53 | +installationVersion: 1.107.1 |
| 54 | +productPath: C:\Users\calvin.allen\AppData\Local\Programs\Microsoft VS Code\Code.exe |
| 55 | +productId: stable |
| 56 | +isPrerelease: false |
| 57 | +displayName: Visual Studio Code |
| 58 | +extensionsPath: C:\Users\calvin.allen\.vscode\extensions |
| 59 | +userDataPath: C:\Users\calvin.allen\AppData\Roaming\Code |
| 60 | +``` |
| 61 | + |
| 62 | +And with `-format json`: |
| 63 | + |
| 64 | +``` |
| 65 | +> vscwhere -format json |
| 66 | +VSCWhere version 0.1.0 |
| 67 | +
|
| 68 | +[ |
| 69 | + { |
| 70 | + "installationPath": "C:\\Users\\calvin.allen\\AppData\\Local\\Programs\\Microsoft VS Code\\", |
| 71 | + "installationVersion": "1.107.1", |
| 72 | + "productPath": "C:\\Users\\calvin.allen\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe", |
| 73 | + "productId": "stable", |
| 74 | + "isPrerelease": false, |
| 75 | + "displayName": "Visual Studio Code", |
| 76 | + "extensionsPath": "C:\\Users\\calvin.allen\\.vscode\\extensions", |
| 77 | + "userDataPath": "C:\\Users\\calvin.allen\\AppData\\Roaming\\Code" |
| 78 | + } |
| 79 | +] |
| 80 | +``` |
| 81 | + |
| 82 | +Also, the most important for workflows, `-nologo` (and combine it with JSON output): |
| 83 | + |
| 84 | +``` |
| 85 | +> vscwhere -nologo -format json |
| 86 | +[ |
| 87 | + { |
| 88 | + "installationPath": "C:\\Users\\calvin.allen\\AppData\\Local\\Programs\\Microsoft VS Code\\", |
| 89 | + "installationVersion": "1.107.1", |
| 90 | + "productPath": "C:\\Users\\calvin.allen\\AppData\\Local\\Programs\\Microsoft VS Code\\Code.exe", |
| 91 | + "productId": "stable", |
| 92 | + "isPrerelease": false, |
| 93 | + "displayName": "Visual Studio Code", |
| 94 | + "extensionsPath": "C:\\Users\\calvin.allen\\.vscode\\extensions", |
| 95 | + "userDataPath": "C:\\Users\\calvin.allen\\AppData\\Roaming\\Code" |
| 96 | + } |
| 97 | +] |
| 98 | +``` |
| 99 | + |
| 100 | +## How Does It Work? |
| 101 | + |
| 102 | +Here's where it gets a little unusual. VS Code doesn't write any special registry keys when it's installed — there's no convenient "here's where I live" entry to read. The *only* registry presence VS Code has is its uninstall entries. |
| 103 | + |
| 104 | +So that's what vscwhere uses. It finds the uninstall entries in the Windows Registry and works backwards to determine the actual installation directory. It's a reliable way to find installations regardless of where the user chose to install them — and really, it's the only way without resorting to scanning the entire filesystem. |
| 105 | + |
| 106 | +## Why Rust? |
| 107 | + |
| 108 | +Executable size. That's it. A .NET trimmed, single-file binary clocked in at 12MB. The Rust version? Under 1MB. For a simple CLI tool that finds VS Code installations, 12MB felt absurd. Rust gives me a tiny, dependency-free binary that's fast and easy to distribute. No runtime dependencies, no installers — just download the executable and run it. |
| 109 | + |
| 110 | +## Current Limitations |
| 111 | + |
| 112 | +A few things to note: |
| 113 | + |
| 114 | +- **Windows only** — macOS and Linux support may come later, but for now it's Windows-focused |
| 115 | +- **No portable installations** — it finds Stable and Insiders builds installed the normal way, but won't detect portable VS Code installations |
| 116 | + |
| 117 | +## Get It |
| 118 | + |
| 119 | +vscwhere is available from GitHub releases. Grab the latest binary and drop it somewhere in your PATH: |
| 120 | + |
| 121 | +[github.com/CodingWithCalvin/vscwhere](https://github.com/CodingWithCalvin/vscwhere) |
| 122 | + |
| 123 | +This is an early release — version 0.1.0 — so there's plenty of room for improvement. If you've got ideas or run into issues, let me know! |
| 124 | + |
| 125 | +As always, I accept pull requests :) |
0 commit comments