A guide to set up separate VS Code installations with different GitHub accounts on Windows (like work vs personal accounts, for example).
- Overview
- Prerequisites
- Step-by-Step Setup
- Creating Custom Icons
- Adding Context Menu Entries
- Testing Your Setup
- Troubleshooting
- Removing the Setup
This setup allows you to:
- Have completely separate VS Code environments (Work & Personal)
- Use different GitHub accounts for each profile
- Launch profiles from desktop shortcuts or right-click context menu
- Keep extensions, settings, and logins independent
What gets separated:
- GitHub account authentication
- Installed extensions
- Editor settings
- Themes and UI customization
- Workspace history
- Windows 10/11
- VS Code already installed
- Administrator access
- PowerShell
Open PowerShell and run:
# Create the main directory
mkdir C:\vscode
# Create work profile directory structure
mkdir C:\vscode\work\data
# Create personal profile directory structure
mkdir C:\vscode\personal\dataCopy your current VS Code settings to both new profiles:
# Copy to work profile
xcopy "C:\Users\YOUR_USERNAME\AppData\Roaming\Code" "C:\vscode\work\data" /E /I /H
# Copy to personal profile
xcopy "C:\Users\YOUR_USERNAME\AppData\Roaming\Code" "C:\vscode\personal\data" /E /I /HReplace YOUR_USERNAME with your actual Windows username.
Create two batch files in C:\vscode\:
File: C:\vscode\vscode-work.bat
@echo off
code --user-data-dir "C:\vscode\work\data" %*File: C:\vscode\vscode-personal.bat
@echo off
code --user-data-dir "C:\vscode\personal\data" %*How to create:
- Open Notepad
- Paste the content
- File → Save As
- Change "Save as type" to All Files
- Save with
.batextension
For Work Profile:
- Right-click Desktop → New → Shortcut
- Location:
C:\vscode\vscode-work.bat - Name:
VS Code - Work - Finish
For Personal Profile:
- Right-click Desktop → New → Shortcut
- Location:
C:\vscode\vscode-personal.bat - Name:
VS Code - Personal - Finish
Using VS Code default icon:
- Right-click shortcut → Properties
- Click Change Icon
- Browse to:
C:\Program Files\Microsoft VS Code\Code.exe - Select icon → OK
Using custom icons:
- Place your
.icofiles inC:\vscode\ - Right-click shortcut → Properties
- Click Change Icon
- Browse to your
.icofile - OK
Download official VS Code icons in PNG format:
- Visit: https://code.visualstudio.com/brand
- Microsoft provides the official VS Code logo and brand assets
Online Converter (Easiest)
- Go to any conversion website
- Upload your PNG file
- Convert to ico extensio and download it
C:\vscode\vscode.ico (Work icon - e.g., official stable icon)
C:\vscode\vscode-alt.ico (Personal icon - e.g., insiders icon or custom)
Tip: Use the official VS Code stable icon for one profile and the Insiders icon (or a custom color variation) for the other to easily distinguish them visually!
This adds "Open with VS Code - Work/Personal" to right-click menus.
VS Code can be installed in two different locations. You need to find which one you have:
Run this in PowerShell:
Get-Command code | Select-Object SourceThis will show you where VS Code is installed. Common locations:
- User Install:
C:\Users\YOUR_USERNAME\AppData\Local\Programs\Microsoft VS Code\Code.exe - System Install:
C:\Program Files\Microsoft VS Code\Code.exe
Note the path - you'll need it for the registry entries below!
Run PowerShell as Administrator.
First, find your VS Code path:
Get-Command code | Select-Object SourceThen use the appropriate commands below:
If VS Code is in AppData\Local (User Install):
# Create HKCR drive
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
# Replace YOUR_USERNAME with your actual Windows username
$vscPath = "C:\Users\YOUR_USERNAME\AppData\Local\Programs\Microsoft VS Code\Code.exe"
# Work Profile - Folder
New-Item -Path "HKCR:\Directory\shell\VSCodeWork" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodeWork" -Name "(Default)" -Value "Open with VS Code - Work"
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodeWork" -Name "Icon" -Value "C:\vscode\vscode.ico"
New-Item -Path "HKCR:\Directory\shell\VSCodeWork\command" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodeWork\command" -Name "(Default)" -Value "`"$vscPath`" --user-data-dir `"C:\vscode\work\data`" `"%1`""
# Personal Profile - Folder
New-Item -Path "HKCR:\Directory\shell\VSCodePersonal" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodePersonal" -Name "(Default)" -Value "Open with VS Code - Personal"
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodePersonal" -Name "Icon" -Value "C:\vscode\vscode-alt.ico"
New-Item -Path "HKCR:\Directory\shell\VSCodePersonal\command" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodePersonal\command" -Name "(Default)" -Value "`"$vscPath`" --user-data-dir `"C:\vscode\personal\data`" `"%1`""
# Work Profile - Background
New-Item -Path "HKCR:\Directory\Background\shell\VSCodeWork" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodeWork" -Name "(Default)" -Value "Open with VS Code - Work"
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodeWork" -Name "Icon" -Value "C:\vscode\vscode.ico"
New-Item -Path "HKCR:\Directory\Background\shell\VSCodeWork\command" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodeWork\command" -Name "(Default)" -Value "`"$vscPath`" --user-data-dir `"C:\vscode\work\data`" `"%V`""
# Personal Profile - Background
New-Item -Path "HKCR:\Directory\Background\shell\VSCodePersonal" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodePersonal" -Name "(Default)" -Value "Open with VS Code - Personal"
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodePersonal" -Name "Icon" -Value "C:\vscode\vscode-alt.ico"
New-Item -Path "HKCR:\Directory\Background\shell\VSCodePersonal\command" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodePersonal\command" -Name "(Default)" -Value "`"$vscPath`" --user-data-dir `"C:\vscode\personal\data`" `"%V`""If VS Code is in Program Files (System Install):
# Create HKCR drive
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
$vscPath = "C:\Program Files\Microsoft VS Code\Code.exe"
# Work Profile - Folder
New-Item -Path "HKCR:\Directory\shell\VSCodeWork" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodeWork" -Name "(Default)" -Value "Open with VS Code - Work"
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodeWork" -Name "Icon" -Value "C:\vscode\vscode.ico"
New-Item -Path "HKCR:\Directory\shell\VSCodeWork\command" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodeWork\command" -Name "(Default)" -Value "`"$vscPath`" --user-data-dir `"C:\vscode\work\data`" `"%1`""
# Personal Profile - Folder
New-Item -Path "HKCR:\Directory\shell\VSCodePersonal" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodePersonal" -Name "(Default)" -Value "Open with VS Code - Personal"
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodePersonal" -Name "Icon" -Value "C:\vscode\vscode-alt.ico"
New-Item -Path "HKCR:\Directory\shell\VSCodePersonal\command" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodePersonal\command" -Name "(Default)" -Value "`"$vscPath`" --user-data-dir `"C:\vscode\personal\data`" `"%1`""
# Work Profile - Background
New-Item -Path "HKCR:\Directory\Background\shell\VSCodeWork" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodeWork" -Name "(Default)" -Value "Open with VS Code - Work"
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodeWork" -Name "Icon" -Value "C:\vscode\vscode.ico"
New-Item -Path "HKCR:\Directory\Background\shell\VSCodeWork\command" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodeWork\command" -Name "(Default)" -Value "`"$vscPath`" --user-data-dir `"C:\vscode\work\data`" `"%V`""
# Personal Profile - Background
New-Item -Path "HKCR:\Directory\Background\shell\VSCodePersonal" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodePersonal" -Name "(Default)" -Value "Open with VS Code - Personal"
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodePersonal" -Name "Icon" -Value "C:\vscode\vscode-alt.ico"
New-Item -Path "HKCR:\Directory\Background\shell\VSCodePersonal\command" -Force | Out-Null
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodePersonal\command" -Name "(Default)" -Value "`"$vscPath`" --user-data-dir `"C:\vscode\personal\data`" `"%V`""If you want to change icons later:
PowerShell (as Administrator):
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodeWork" -Name "Icon" -Value "C:\vscode\vscode.ico"
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodeWork" -Name "Icon" -Value "C:\vscode\vscode.ico"
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodePersonal" -Name "Icon" -Value "C:\vscode\vscode-alt.ico"
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodePersonal" -Name "Icon" -Value "C:\vscode\vscode-alt.ico"- Double-click VS Code - Work shortcut
- VS Code should open
- Sign in with your work GitHub account
- Close VS Code
- Double-click VS Code - Personal shortcut
- Sign in with your personal GitHub account
- Right-click any folder
- You should see:
- Open with VS Code - Work
- Open with VS Code - Personal
- Click one to test
- Open both profiles simultaneously
- Check GitHub account in each (click account icon, bottom-left)
- They should show different accounts
In each VS Code window:
- Go to Help → About
- Check "User data directory"
- Should show
C:\vscode\work\dataorC:\vscode\personal\data
Solution 1: Refresh File Explorer
- Press
F5in File Explorer - Or close and reopen File Explorer
Solution 2: Verify Registry Entries
PowerShell:
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
Test-Path "HKCR:\Directory\shell\VSCodeWork"
Test-Path "HKCR:\Directory\shell\VSCodePersonal"Both should return True.
Solution 3: Check VS Code Installation Path
If VS Code is installed elsewhere, update the path:
Get-Command code | Select-Object SourceThen update the registry entries with the correct path.
This is usually because VS Code is installed in a different location than the registry expects.
Diagnose the issue:
# Check where VS Code is actually installed
Get-Command code | Select-Object Source
# Check what the registry has
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
Get-ItemProperty "HKCR:\Directory\shell\VSCodeWork\command" | Select-Object '(default)'Common VS Code locations:
- User Install:
C:\Users\YOUR_USERNAME\AppData\Local\Programs\Microsoft VS Code\Code.exe - System Install:
C:\Program Files\Microsoft VS Code\Code.exe
Fix:
Once you know the correct path, update the registry entries:
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
# Replace with YOUR actual VS Code path
$correctPath = "C:\Users\YOUR_USERNAME\AppData\Local\Programs\Microsoft VS Code\Code.exe"
# Update all four entries
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodeWork\command" -Name "(Default)" -Value "`"$correctPath`" --user-data-dir `"C:\vscode\work\data`" `"%1`""
Set-ItemProperty -Path "HKCR:\Directory\shell\VSCodePersonal\command" -Name "(Default)" -Value "`"$correctPath`" --user-data-dir `"C:\vscode\personal\data`" `"%1`""
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodeWork\command" -Name "(Default)" -Value "`"$correctPath`" --user-data-dir `"C:\vscode\work\data`" `"%V`""
Set-ItemProperty -Path "HKCR:\Directory\Background\shell\VSCodePersonal\command" -Name "(Default)" -Value "`"$correctPath`" --user-data-dir `"C:\vscode\personal\data`" `"%V`""Or recreate the .reg file with the correct path (see the Adding Context Menu Entries section).
Check:
- Icon files exist at specified paths
- Files have
.icoextension - File paths in registry match actual locations
- Refresh File Explorer (F5)
Solution:
- Run PowerShell as Administrator
- Win+X → Terminal (Admin)
Solution:
- Sign out from both profiles
- Open Work profile → Sign in with work account
- Close completely
- Open Personal profile → Sign in with personal account
- Each profile stores credentials independently
This is normal!
- The default context menu still uses
C:\Users\YOUR_USERNAME\AppData\Roaming\Code - Use your new custom menu entries instead
- Or sign into the original with a different account
Using PowerShell (as Admin):
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
Remove-Item -Path "HKCR:\Directory\shell\VSCodeWork" -Recurse -Force
Remove-Item -Path "HKCR:\Directory\shell\VSCodePersonal" -Recurse -Force
Remove-Item -Path "HKCR:\Directory\Background\shell\VSCodeWork" -Recurse -Force
Remove-Item -Path "HKCR:\Directory\Background\shell\VSCodePersonal" -Recurse -ForcePowerShell:
Remove-Item -Path "C:\vscode" -Recurse -ForceSimply delete the shortcuts from your desktop.
C:\vscode\
├── work\
│ └── data\ (Work profile data)
├── personal\
│ └── data\ (Personal profile data)
├── vscode.ico (Work icon - optional)
├── vscode-alt.ico (Personal icon - optional)
├── vscode-work.bat (Work launcher)
└── vscode-personal.bat (Personal launcher)
# Check if profiles exist
Test-Path "C:\vscode\work\data"
Test-Path "C:\vscode\personal\data"
# Check registry entries
New-PSDrive -Name HKCR -PSProvider Registry -Root HKEY_CLASSES_ROOT
Test-Path "HKCR:\Directory\shell\VSCodeWork"# Work profile
C:\vscode\vscode-work.bat "C:\Projects\WorkProject"
# Personal profile
C:\vscode\vscode-personal.bat "C:\Projects\PersonalProject"- VS Code Profiles Documentation
- Managing Multiple GitHub Accounts with SSH
- VS Code Command Line Interface
Note: This guide assumes VS Code is installed in one of these common locations:
- User Install:
C:\Users\YOUR_USERNAME\AppData\Local\Programs\Microsoft VS Code\Code.exe - System Install:
C:\Program Files\Microsoft VS Code\Code.exe
If your installation is elsewhere, adjust the paths accordingly. Use Get-Command code | Select-Object Source in PowerShell to find your VS Code installation path.