If you’re like me you probably have some home projects or CPD (Continuing Professional Development) on the go. Microsoft VSCode has the concept of Workspaces, so in my case I have a workspace for Personal projects and a workspace for Work projects.
But it would be nice to be able to just start Microsoft VSCode straight into your desired workspace. I’m using Microsoft Windows, but similar approaches can be use with MacOS and Linux (although these are not covered here).
Firstly create and save you Personal and Work workspaces so you have two files: personal.code-workspace and work.code-workspace.
All you need to do is create a shortcut with the following “Target” and “Start In”, shown below is one for your Personal workspace.
Target: "C:\Users\bobsmith\AppData\Local\Programs\Microsoft VS Code\Code.exe" "c:/Users/bobsmith/Documents/vscode/personal.code-workspace"
Start in: "C:\Users\bobsmith\AppData\Local\Programs\Microsoft VS Code"
And one for your Work workspace:
Target: "C:\Users\bobsmith\AppData\Local\Programs\Microsoft VS Code\Code.exe" "c:/Users/bobsmith/Documents/vscode/work.code-workspace"
Start in: "C:\Users\bobsmith\AppData\Local\Programs\Microsoft VS Code"
And that’s it, you should now be able to easily start direct into your desired workspace.