From: newskrawl@krawl.org   
      
   On Sun, 23 Nov 2025 05:08:55 -0000 (UTC), NewsKrawler wrote:   
   I'm going to re-install all browsers as portable apps   
   that will install as portable apps, to save C: space.   
      
   I got tired of symlinking browser cache manually   
   so I wrote this.   
      
    :: 20251124 setsymlink.bat version 1.0   
    :: One-time setup to redirect browser caches (Firefox, Chrome, Edge)   
    :: from C:\Users\\AppData\Local to D:\user\Cache folders.   
    :: Frees space on C:\ by ensuring future cache growth happens on D:\.   
    :: Usage:   
    :: - Run as Administrator (auto-elevates if not).   
    :: - Execute this script only once per system setup.   
    :: - After symlinks are created, do NOT rerun unless you remove them.   
    :: Notes:   
    :: - Uses %localappdata% for portability across user accounts.   
    :: - Creates D:\user\FirefoxCache, D:\user\ChromeCache, D:\user\EdgeCache   
    :: if they do not already exist.   
    :: - Deletes existing cache folders before linking.   
    :: - Logs symlink creation to console.   
    :: - Symlinks persist until manually removed.   
    :: ============================================================   
    @echo off   
    :: setup_symlinks.bat   
    :: Run as admin   
    net session >nul 2>&1   
    if %errorlevel% neq 0 (   
    echo Requesting administrator privileges...   
    powershell -Command "Start-Process '%~f0' -Verb RunAs"   
    exit /b   
    )   
      
    :: Firefox cache symlinks   
    for /d %%P in ("%localappdata%\Mozilla\Firefox\Profiles\*") do (   
    if exist "%%P\cache2" rd /s /q "%%P\cache2"   
    if not exist "D:\user\FirefoxCache" mkdir "D:\user\FirefoxCache"   
    mklink /D "%%P\cache2" "D:\user\FirefoxCache"   
    echo Symlink created for %%P\cache2   
    )   
      
    :: Chrome cache symlink   
    if exist "%localappdata%\Google\Chrome\User Data\Default\Cache" (   
    rd /s /q "%localappdata%\Google\Chrome\User Data\Default\Cache"   
    )   
    if not exist "D:\user\ChromeCache" mkdir "D:\user\ChromeCache"   
    mklink /D "%localappdata%\Google\Chrome\User Data\Default\Cache"   
   "D:\user\ChromeCache"   
      
    :: Edge cache symlink   
    if exist "%localappdata%\Microsoft\Edge\User Data\Default\Cache" (   
    rd /s /q "%localappdata%\Microsoft\Edge\User Data\Default\Cache"   
    )   
    if not exist "D:\user\EdgeCache" mkdir "D:\user\EdgeCache"   
    mklink /D "%localappdata%\Microsoft\Edge\User Data\Default\Cache"   
   "D:\user\EdgeCache"   
      
    pause   
   --   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|