Move C:\ProgramData\Package Cache\ to D:\

Windows with a couple of development tools takes up about 126GB of my 128GB SSD, to free-up some space I followed the guide at: http://www.hanselman.com/blog/GuideToFreeingUpDiskSpaceUnderWindows81.aspx

 

Then I moved the "C:\ProgramData\Package Cache" used by Visual Studio to D:\.

 

I did this by following the instructions at: http://superuser.com/questions/455853/can-i-delete-the-the-folder-c-programdata-package-cache

 

1. Move folder from C:\ProgramData to D:\ProgramData

This must be a move of the complete “Package Cache” folder, so after move you will have a folder C:\ProgramData, that does NOT contain the folder “Package Cache”.

2. Create a filesystem junction: mklink /J "C:\ProgramData\Package Cache" "D:\ProgramData\Package Cache"

This will create a filesystem junction, that will point all software that wants to access  "C:\ProgramData\Package Cache" to "D:\ProgramData\Packa Cache".

 

That alone saved me about 6GB.

3 Comments

  1. Wibble

    Don’t know how old this page. But for VS 2015, this won’t work. Installing an update like TypeScript will delete the junction.

    There’s possibly a registry hack for WiX that will do it. But it didn’t work for me.

    There’s also a really convoluted method of setting up a virtual HDD to host the packages, with the VHD sitting on a different drive. Seems way too complex for what should be a simple problem.

    Not anti MS, but will they get it through their heads that people may not want to stuff everything in C:!

  2. Luca Gigli

    I’ve done this procedure in the past, but I’ve some issues now, so I need to move back Package cache from D: to C:, deleting the filesystem junction. How can I do?

    Thank you
    Luca

  3. jungle_mole

    looks like it is not only me who is suffering..
    also funny thing, i took ownership, deprived system from all prermissions except enumeration on that folder symlink, and guess what, 0 fucks were given. that’s the spirit! it amuses me very much, really, spending half a day searching why some windows own service stopped to work just to find it messed itself’s permissions and cant change them even having a right to grab ownership and THIS: completely no rights and it just deletes folder. why is that permissions system needed in that case, when it can be ignored so easily? is it needed just to cause trouble as i described before, but here comes the moment when it can be rly useful, just for you to find it is a zilch.

    why you even need to remove this folder anyway, being a system. what sense??

    this damn thing pissed me off so much, until i finally figured it out. not really like that.. i’ve found problem pretty quickly, “fixed” and moved on with reinstallation of visual studio and so on. i was thinking i fixed folder, so being sure of it spent another few hours struggling..

    that’s so fucked up rly..
    another great thing from not far ago was, i have gdrive dropbox and onedrive on D and from ancient times i were using symlinks to backup different stuff there. how big was my amazement, when i’d discovered some folders wasnt backing up for 2-3 months already!
    spent several days struggling with that “issue”, “malfunction”.. was thinking something had broken. and i were right. that were MS employees’ brains.. they just had broken that “feature”, intentionally or not and just don’t give a fuck.. actually it’s not windows feature, but ntfs’s anyway. they don’t want it lol. the solution was to move back winapps to C and clear system volume information folder.

    i definitely can see some pattern here.. forcing users to live on C. it’s antihuman.
    i’m not m$ hater, actually i’m loving it, but those few things made me so mad.. i wasted shit ton of time for no reason -__-

    now i will try to actually not move package cache, but move all folders from within it and see what happens.
    also i will try to move it to disk C and see if symlink persists. in the case of success i see a way to trick that stupid system.

Leave a Reply

Your email address will not be published. Required fields are marked *