11

I'm on a company laptop and appdata has restricted storage space. An initial google showed there isn't really any settings to move directories. I was thinking of simply copying relevant directories i.e. \AppData\Roaming\Code to somewhere else, then creating a hard symbolic link (junction) with the same name and then point it to the same location

i.e. in command line:

mklink /J C:\Users\me\AppData\Roaming\Code C:\myFolder\Code

I played around with moving the whole appdata folder (right click on roaming/local/locallow then click on properties then location tab then change directory). I managed to only move half the files over. it seemed to work until i restarted and it caused chaos.

I don't want the same thing to happen again with vscode. (that said I haven't tried using a symbolic link for appdata

what is everyone's advice? can i create a symbolic link and have everything work fine? or will i cause more chaos again? if it works for vscode, i'd like to do the same for appdata too

danglingpointer
  • 4,708
  • 3
  • 24
  • 42
user3120554
  • 641
  • 2
  • 11
  • 21

2 Answers2

13

Portable Mode in Visual Studio Code You can use Portable Mode: After unzipping the VS Code download, simply create a data folder within Code's folder

After first launch 2 folders will be generated inside:

..data\extensions
..data\user-data

Then you can copy your company folders with files from

%APPDATA%\Code\User\

Then copy the extensions directory to data:

%USERPROFILE%\.vscode\extensions

Portable mode is not supported if you install VS Code. It is only supported if you get the ZIP download.

AndriuZ
  • 648
  • 6
  • 26
8

Symbolic links should work, but you can also tell VS Code to use a custom extension and user setting location with the --extensions-dir and --user-data-dir flags respectively

$ code --extensions-dir "/User/me/vscodeExtensions" --user-data-dir "/User/me/vscodeData"

There are some key limitations to this approach, such as extension updates not working. We are tracking support for a truly portable VS Code here: https://github.com/Microsoft/vscode/issues/329

Herohtar
  • 5,347
  • 4
  • 31
  • 41
Matt Bierner
  • 58,117
  • 21
  • 175
  • 206