VSCode: moving files out of appdata directory
Asked Answered
A

2

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

Ammon answered 1/8, 2017 at 17:36 Comment(0)
H
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.

Havener answered 8/8, 2018 at 1:42 Comment(0)
I
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

Imbecilic answered 3/8, 2017 at 1:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.