Created
March 21, 2025 10:14
-
-
Save shakeyourbunny/34ffbe6e5af4ec2bf8794769086002a0 to your computer and use it in GitHub Desktop.
extend hard disk space by symlinking directories to a secondary drive.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
rem CHANGE THESE FOLDERS APPROPRIATELY!! | |
set OFDIR=M:\SITES\GOG_OVERFLOW | |
set DESTDIR=R:\SITES\GOG | |
echo ---- relink GOG disk folders ---- | |
echo . (c) 2022/08 shakeyourbunny | |
echo. | |
echo PRIMARY GOG archive disk folder: %DESTDIR% | |
echo OVERFLOW GOG disk folder : %OFDIR% | |
echo. | |
echo !!!! CHECK YOUR FOLDERS FIRST BEFORE PROCEEDING !!!!! | |
echo (you also need admin privileges for doing that) | |
echo. | |
echo. | |
echo !!! symbolic links on %DESTDIR% WILL BE DELETED AND RECREATED!!!! | |
echo. | |
echo Stop now with ctrl+c or ... | |
pause | |
cd /D %DESTDIR% | |
echo Removing all symbolic links on %DESTDIR%. | |
for /f %%c in ('dir /al /b') do rmdir %%c | |
dir /b /Ad %OFDIR% > overflow_directories.txt | |
for /f %%c in ('type overflow_directories.txt') do mklink /D %%c %OFDIR%\%%c | |
echo. | |
echo Done. | |
pause |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This script adds all directorys from %OFDIR% into the %DESTDIR" as symbolic links.
In essence, you just move your offline GOG folders to the other drive into %OFDIR%, start the script and they will be linked back as symbolic links. The download scripts (ie gogrepoc) should not notice a difference and their downloads will be redirected to the respective folder in %OFDIR%.
Some notes: