How to move the Visual Studio Code extensions folder on Windows

I recently started using Visual Studio Code at work. We have a size limit on our profile and VS Code’s extensions folder chews up space very quickly. So I had to work out how to move the extensions folder from the default location to stop it from counting against my quota.

To change the location of the extensions folder there’s a command line parameter --extensions-folder you can use. You will need to update all the Visual Studio Code shortcuts (taskbar, start menu, etc) as well as context menu “Open in Code” options for folders and background in Windows Explorer.

How to update shortcuts

  • Open the properties dialog for the Visual Studio Code shortcut
  • Append --extensions-folder=[alternative path for extensions folder]  to Target

For example,

Visual Studio Code shortcut properties dialog

How to update context menu “Open with Code” options

  • Open Regedit as Administrator
  • Navigate to Computer\HKEY_CLASSES_ROOT\directory\shell\VSCode\command
  • Append --extensions-folder=[alternative path for extensions folder] the value (Default)
  • Navigate to Computer\HKEY_CLASSES_ROOT\directory\background\shell\VSCode\command
  • Append --extensions-folder=[alternative path for extensions folder] the value (Default)

Visual Studio Code context menu option

Visual Studio Code Regedit