home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   alt.comp.os.windows-10      Steaming pile of horseshit Windows 10      197,590 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 195,818 of 197,590   
   NewsKrawler to All   
   Re: cleanpc.bat script to clean hp strea   
   26 Nov 25 17:40:52   
   
   From: newskrawl@krawl.org   
      
   Every day I nuke more "stuff" to gain space on C: where this effort is a   
   lesson in a few important things about Windows storage and bloatware.   
    1. A 32GB C: drive is just too damn tiny   
    2. You learn how much bloat is there when you need to remove it all   
    3. Every bit of bloat has a DIFFERENT way of removing it   
      
   Here I'm removing all non-necessary fonts.   
      
    # 20251126 backupfonts.ps1 version 1.4   
    # Run this script from an elevated Command Prompt (Administrator):   
    # powershell -ExecutionPolicy Bypass -File ".\backupfonts.ps1"   
    #   
    # Purpose:   
    # Move large non-Latin fonts (Chinese, Japanese, Korean, Indic, etc.) off C:   
    # Back them up to D:\user\OEM\font so they can be restored if needed   
    # Remove their registry entries so Windows no longer tries to load them   
    # Log actions (moved fonts and removed registry entries) to a timestamped file   
    #  List fonts: Get-ChildItem -Path "C:\Windows\Fonts" | Select Name, Length   
    #  Sort by size   
    #  Get-ChildItem -Path "C:\Windows\Fonts" |   
    #   Sort-Object Length -Descending |   
    #   Select-Object Name, @{Name="SizeMB";Expression={[math]::Rou   
   d($_.Length/1MB,2)}}   
    #  Map font names to files   
    #  Get-ItemProperty "HKLM:\SOFTWARE\Microsoft\Windows NT\Curren   
   Version\Fonts" |   
    #  Select-Object PSChildName, (Get-ItemPropertyValue $_.PSPath)   
    #  Settings > Personalization > Fonts   
    #  Keep Segoe UI (used for Windows UI)   
    #  Keep Arial, Times New Roman, Calibri, Cambria   
    #  Keep Consolas (used in command prompt/PowerShell)   
    #  Keep Courier New, Verdana, Tahoma   
    #  Remove SimSun, MingLiU, MS Mincho, Yu Gothic, Malgun Gothic   
    #  Remove Nirmala UI(Indic), Gulim(Korean), Batang(Korean), MS    
   othic(Japanese)   
    #  Remove Jokerman, Curlz MT, Comic Sans   
      
    # -------------------------------   
    # 1. Set backup destination folder   
    # -------------------------------   
    $backup = "D:\user\OEM\font"   
    New-Item -ItemType Directory -Force -Path $backup   
      
    # -------------------------------   
    # 2. Create log directory & file   
    # -------------------------------   
    # Logs will be stored in a "log" subdirectory of the current working folder   
    $logDir = Join-Path (Get-Location) "log"   
    New-Item -ItemType Directory -Force -Path $logDir | Out-Null   
      
    # Create a timestamped log file (e.g. backupfonts_20251126_0930.log)   
    $timestamp = Get-Date -Format "yyyyMMdd_HHmmss"   
    $logFile = Join-Path $logDir "backupfonts_$timestamp.log"   
      
    # -------------------------------   
    # 3. Define fonts to move   
    # -------------------------------   
    # These are the largest families (CJK + Indic + Tibetan/Uighur)   
    # Each entry is a file path or wildcard pattern   
    $fontsToMove = @(   
        "C:\Windows\Fonts\mingliub.ttc",      # MingLiU (Chinese)   
        "C:\Windows\Fonts\simsunb.ttf",       # SimSun Bold (Chinese)   
        "C:\Windows\Fonts\simsun.ttc",        # SimSun (Chinese)   
        "C:\Windows\Fonts\SimsunExtG.ttf",    # SimSun Extended (Chinese)   
        "C:\Windows\Fonts\msjh.ttc",          # MS JhengHei (Traditional Chinese)   
        "C:\Windows\Fonts\msjhbd.ttc",        # MS JhengHei Bold   
        "C:\Windows\Fonts\msjhl.ttc",         # MS JhengHei Light   
        "C:\Windows\Fonts\msyh.ttc",          # MS YaHei (Simplified Chinese)   
        "C:\Windows\Fonts\msyhbd.ttc",        # MS YaHei Bold   
        "C:\Windows\Fonts\msyhl.ttc",         # MS YaHei Light   
        "C:\Windows\Fonts\msgothic.ttc",      # MS Gothic (Japanese)   
        "C:\Windows\Fonts\YuGoth*.ttc",       # Yu Gothic family (Japanese)   
        "C:\Windows\Fonts\malgun*.ttf",       # Malgun Gothic family (Korean)   
        "C:\Windows\Fonts\Nirmala*.ttf",      # Nirmala UI family (Indic scripts)   
        "C:\Windows\Fonts\MSUIGHUR.TTF",      # Microsoft Uighur   
        "C:\Windows\Fonts\MSUIGHUB.TTF",      # Microsoft Uighur Bold   
        "C:\Windows\Fonts\himalaya.ttf",      # Microsoft Himalaya (Tibetan)   
        "C:\Windows\Fonts\phagspa.ttf"        # Microsoft PhagsPa (Mongolian)   
    )   
      
    # -------------------------------   
    # 4. Move fonts to backup folder   
    # -------------------------------   
    foreach ($fontPath in $fontsToMove) {   
        Get-ChildItem $fontPath -ErrorAction SilentlyContinue | ForEach-Object {   
            try {   
                Move-Item $_.FullName -Destination $backup -Force -ErrorAction   
   Stop   
                Add-Content $logFile "Moved font: $($_.Name)"   
            } catch {   
                Copy-Item $_.FullName -Destination $backup -Force   
                Add-Content $logFile "Copied font (move denied): $($_.Name)"   
            }   
        }   
    }   
      
    # -------------------------------   
    # 5. Registry cleanup   
    # -------------------------------   
    # Fonts are registered under HKLM:\SOFTWARE\Microsoft\Windows N   
   \CurrentVersion\Fonts   
    # Removing entries prevents Windows from trying to load missing fonts   
    $fontRegPath = "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts"   
      
    $fontsToRemove = @(   
        # Chinese fonts   
        "MingLiU & MingLiU-ExtB (TrueType)",   
        "SimSun (TrueType)",   
        "SimSun-ExtB (TrueType)",   
      
        # Japanese fonts   
        "MS JhengHei (TrueType)",   
        "MS JhengHei Bold (TrueType)",   
        "MS JhengHei Light (TrueType)",   
        "MS YaHei (TrueType)",   
        "MS YaHei Bold (TrueType)",   
        "MS YaHei Light (TrueType)",   
        "MS Gothic (TrueType)",   
        "Yu Gothic (TrueType)",   
        "Yu Gothic Bold (TrueType)",   
        "Yu Gothic Light (TrueType)",   
        "Yu Gothic Medium (TrueType)",   
      
        # Korean fonts   
        "Malgun Gothic (TrueType)",   
        "Malgun Gothic Bold (TrueType)",   
        "Malgun Gothic Semilight (TrueType)",   
      
        # Indic fonts   
        "Nirmala UI (TrueType)",   
        "Nirmala UI Bold (TrueType)",   
        "Nirmala UI Semilight (TrueType)",   
      
        # Other non-Latin scripts   
        "Microsoft Himalaya (TrueType)",   
        "Microsoft PhagsPa (TrueType)",   
        "Microsoft Uighur (TrueType)"   
    )   
      
    foreach ($font in $fontsToRemove) {   
        if (Get-ItemProperty -Path $fontRegPath -Name $font -ErrorAction   
   SilentlyContinue) {   
            Remove-ItemProperty -Path $fontRegPath -Name $font -ErrorAction   
   SilentlyContinue   
            Add-Content $logFile "Removed registry entry: $font"   
        }   
    }   
      
    # -------------------------------   
    # 6. Completion message   
    # -------------------------------   
    Add-Content $logFile "Backup completed at $(Get-Date)"   
    Write-Output "Fonts moved/copied to $backup and registry entries cleaned."   
    Write-Output "Log saved to $logFile."   
    Write-Output "Please reboot to finalize changes."   
      
    # -------------------------------   
    # 7. Post-run guidance   
    # -------------------------------   
    # After reboot, check the log file to see which fonts were 'Moved' vs   
   'Copied'.   
    # Moved fonts: These are no longer in C:\Windows\Fonts.   
    #  Space is reclaimed immediately.   
    #  They are backed up in D:\user\OEM\font and can be restored if needed.   
    # Copied fonts: These remain in C:\Windows\Fonts because Windows locked them.   
    #  Registry entries were removed, so they are unused after reboot.   
      
   [continued in next message]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca