Jump to content
LaunchBox Community Forums

2 Screenshots

About This File

LaunchBox Precache Manager (LPM) V.1.0 PS (powershell version)

Mass image optimizer + precache system for LaunchBox libraries (PowerShell 5.1, ASCII-only).

TL;DR

LPM scans your LaunchBox Images folder, builds a compressed WebP/JPEG precache into:

LaunchBox\Images\_Precache

…then (optionally) swaps your original image folders for the precache using NTFS junctions.

Original art is protected in: Images\_Originals

LaunchBox/Big Box browsing gets faster and lighter

You can restore originals at any time

Designed for very large libraries (hundreds of thousands to millions of images).

What’s included

This package contains two main scripts:

LB-Precache-Manager.ps1 – interactive front-end menu (the “manager”)

Build-LaunchBox-Thumbnails-Parallel.ps1 – the “engine” that does the heavy lifting

Optional (recommended):

cwebp.exe – Google WebP encoder (best compression / speed)

Launcher:

Launch-LPM.cmd (optional convenience)
You can also run the manager directly with PowerShell.

High-level workflow

Audit your Images folder (counts, types, savings estimates).

Build thumbnails (create/update files in Images\_Precache).

Backfill later (fill gaps only after partial runs or new content).

Activate Precache (parks originals into _Originals, junction-swaps to _Precache).

Restore Originals (undo junction swap, put everything back).

Rebuild existing precache later with a new profile if you want tighter compression.

Important notes up front

Close LaunchBox and Big Box before running (especially Activate/Restore).
Locked folders will be skipped.

Back up first.
Make a backup/snapshot of your LaunchBox folder if you’re cautious (recommended for first-time users).

LPM does not change your game metadata except when you explicitly use:

Clean XML references (only removes references to images already moved to _BadImages).

Remote / network / external path warning (important)

LPM is built for local, fixed disks.

If your LaunchBox path is a mapped drive / UNC path / remote share, some operations will refuse to run and you will see:

Remote paths not supported; run on the Launchbox PC.

This prevents multi-day failures, broken junctions, and extreme slowdowns.

SAFE vs FULL run mode

At startup you’ll choose a run mode:

SAFE: low impact (older/USB systems)

FULL: uses hardware recommendations for faster multi-threaded work (best on SSD/NVMe)

FULL mode will also show detected hardware and recommended defaults (workers/batch sizing).

Why counts don’t always match

It’s normal to see differences between:

a simple file count script, and

what the engine prints during scanning/building

Reasons:

The engine may walk additional internal paths (depending on mode and what already exists in your Images tree).

“Visited directories” and “files matched” are progress counters, not a strict “real folder count.”

Bottom line: don’t panic if counts don’t line up perfectly, especially after multiple runs or after Activate/Restore operations.

Handling locked folders / “file in use”

During Activate/Restore (and sometimes builds), you may see locked items skipped.

What it means:

LaunchBox/Big Box/Explorer/AV has something open.

What LPM does:

prints a warning

continues with the rest (doesn’t abort the entire run)

Fix:

close LB/BB

re-run the option (safe to re-run)

Installation

Extract the zip anywhere (Desktop/tools folder).

Run one of:

Launch-LPM.cmd (recommended convenience)

or open PowerShell and run: .\LB-Precache-Manager.ps1

Recommended:

Run PowerShell as Administrator for:

junction swap operations

optional Defender exclusion

standby-cache clearing (RAM file cache)

Logging

LPM supports two concepts:

1) Feature state (always-on)

LPM-Answers-Last.json
This stores the last answered prompts so you can re-run the same build easily (Repeat mode uses this).
This is NOT a log and remains on by default.

2) Session logs (optional)

You may be asked early in startup whether to disable session logs.

Default: logs enabled

If disabled: fewer files written; console output still appears

Batch mode also maintains small state/summary files so it can resume safely.

Main Menu (Manager)

You’ll see:

Main Menu
[0] Audit images (recommended first step)
[1] Build Thumbnails
[2] Activate Precache (junction swap)
[3] Restore Originals
[4] Clean XML references
[5] Backfill missing precache from Images
[6] Rebuild existing precache at new profile
[7] Exit
[B] Batch run-all (50,000 cap per session)
[R] Repeat last build (use saved answers)
[T] Clean LPM temp files (optional)

[0] Audit images

Walks the Images tree and produces:

counts

convertible totals

rough space saving estimates

planning hints per profile

Outputs:

lb_audit.json

lb_audit.csv

[1] Build Thumbnails

Creates/updates the precache under:

LaunchBox\Images\_Precache\...

Profiles:

Fast

Balanced

Extreme

Custom

Notes:

If cwebp.exe is present, WebP is used (best compression).

You can force JPEG-only (optional).

[2] Activate Precache (junction swap)

“Turns it on.”

Moves originals to Images\_Originals\...

Creates junctions under Images\... pointing to _Precache

[3] Restore Originals

Undoes Activate:

removes junctions

moves originals back from _Originals

[4] Clean XML references

Advanced/optional cleanup for broken image refs linked to _BadImages.

[5] Backfill missing precache from Images

Fills only what’s missing:

finds originals without corresponding precache output

generates precache copies only for those

[6] Rebuild existing precache at new profile

Re-encodes existing precache using a different profile (only replaces when beneficial, depending on settings).

[B] Batch run-all (50,000 cap per session)

This is for huge libraries with hundreds+ platforms/folders.

What it does:

Iterates through platform folders under Images

Processes them in segments capped at 50,000 per batch session

Writes output into: Images\_Precache\<Platform>\...

Can resume where it left off in later runs using a state file

Behavior:

Prompts per platform with an auto-default (so you can run unattended)

Designed so you can run overnight without bogging down the machine for days in one “run all”

Batch state:

LaunchBoxRoot\LPM-Batch-State.json (resume point / continuation)

Batch summary:

Writes short progress summaries to the LaunchBox root (easy to find)

Also:

Batch runs can clear standby cache automatically (admin required) before segments to reduce cache thrash.

[R] Repeat last build (use saved answers)

Re-runs your last answered configuration using:

LPM-Answers-Last.json

This is the “do exactly what I did last time” option.

[T] Clean LPM temp files (optional)

Cleans LPM temporary working files (typically under Windows %TEMP% related to LPM processing).
This is safe housekeeping and does not change your LaunchBox Images content.

Notes about WebP + LaunchBox

LaunchBox can display WebP files when they’re in place in the Images tree, but:

Drag/drop and scraping workflows typically expect PNG/JPG sources.

LPM’s approach keeps originals safe, while precache improves performance.

Clear Logos:

PNG sources are strongly recommended (transparency matters).

Recommendation for first-time users

Run Audit

Run Build Thumbnails with Balanced

Test LaunchBox/Big Box performance

Then consider Activate Precache

Support / community

Let me know below if you have suggestions for improvement, or if you dfind something that doesn't work as intended.

If you like this and want to help me out, buy me a coffee :)
https://buymeacoffee.com/mcflylpm

 

 

 

Edited by -McFly-
updated the readme


What's New in Version 1.0 PS   See changelog

Released

LaunchBox Precache Manager (LPM) V1.0 PS (powershell version)

Mass image optimizer + precache system for LaunchBox libraries (PowerShell 5.1, ASCII-only).

TL;DR

LPM scans your LaunchBox Images folder, builds a compressed WebP/JPEG precache into:

  • LaunchBox\Images\_Precache

…then (optionally) swaps your original image folders for the precache using NTFS junctions.

  • Original art is protected in: Images\_Originals

  • LaunchBox/Big Box browsing gets faster and lighter

  • You can restore originals at any time

Designed for very large libraries (hundreds of thousands to millions of images).


What’s included

This package contains two main scripts:

  • LB-Precache-Manager.ps1 – interactive front-end menu (the “manager”)

  • Build-LaunchBox-Thumbnails-Parallel.ps1 – the “engine” that does the heavy lifting

Optional (recommended):

  • cwebp.exe – Google WebP encoder (best compression / speed)

Launcher:

  • Launch-LPM.cmd (optional convenience)
    You can also run the manager directly with PowerShell.


High-level workflow

  1. Audit your Images folder (counts, types, savings estimates).

  2. Build thumbnails (create/update files in Images\_Precache).

  3. Backfill later (fill gaps only after partial runs or new content).

  4. Activate Precache (parks originals into _Originals, junction-swaps to _Precache).

  5. Restore Originals (undo junction swap, put everything back).

  6. Rebuild existing precache later with a new profile if you want tighter compression.


Important notes up front

  • Close LaunchBox and Big Box before running (especially Activate/Restore).
    Locked folders will be skipped.

  • Back up first.
    Make a backup/snapshot of your LaunchBox folder if you’re cautious (recommended for first-time users).

  • LPM does not change your game metadata except when you explicitly use:

    • Clean XML references (only removes references to images already moved to _BadImages).


Remote / network / external path warning (important)

LPM is built for local, fixed disks.

If your LaunchBox path is a mapped drive / UNC path / remote share, some operations will refuse to run and you will see:

Remote paths not supported; run on the Launchbox PC.

This prevents multi-day failures, broken junctions, and extreme slowdowns.


SAFE vs FULL run mode

At startup you’ll choose a run mode:

  • SAFE: low impact (older/USB systems)

  • FULL: uses hardware recommendations for faster multi-threaded work (best on SSD/NVMe)

FULL mode will also show detected hardware and recommended defaults (workers/batch sizing).


Why counts don’t always match

It’s normal to see differences between:

  • a simple file count script, and

  • what the engine prints during scanning/building

Reasons:

  • The engine may walk additional internal paths (depending on mode and what already exists in your Images tree).

  • “Visited directories” and “files matched” are progress counters, not a strict “real folder count.”

Bottom line: don’t panic if counts don’t line up perfectly, especially after multiple runs or after Activate/Restore operations.


Handling locked folders / “file in use”

During Activate/Restore (and sometimes builds), you may see locked items skipped.

What it means:

  • LaunchBox/Big Box/Explorer/AV has something open.

What LPM does:

  • prints a warning

  • continues with the rest (doesn’t abort the entire run)

Fix:

  • close LB/BB

  • re-run the option (safe to re-run)


Installation

  1. Extract the zip anywhere (Desktop/tools folder).

  2. Run one of:

    • Launch-LPM.cmd (recommended convenience)

    • or open PowerShell and run: .\LB-Precache-Manager.ps1

Recommended:

  • Run PowerShell as Administrator for:

    • junction swap operations

    • optional Defender exclusion

    • standby-cache clearing (RAM file cache)


Logging

LPM supports two concepts:

1) Feature state (always-on)

  • LPM-Answers-Last.json
    This stores the last answered prompts so you can re-run the same build easily (Repeat mode uses this).
    This is NOT a log and remains on by default.

2) Session logs (optional)

You may be asked early in startup whether to disable session logs.

  • Default: logs enabled

  • If disabled: fewer files written; console output still appears

Batch mode also maintains small state/summary files so it can resume safely.


Main Menu (Manager)

You’ll see:

Main Menu
[0] Audit images (recommended first step)
[1] Build Thumbnails
[2] Activate Precache (junction swap)
[3] Restore Originals
[4] Clean XML references
[5] Backfill missing precache from Images
[6] Rebuild existing precache at new profile
[7] Exit
[B] Batch run-all (50,000 cap per session)
[R] Repeat last build (use saved answers)
[T] Clean LPM temp files (optional)

[0] Audit images

Walks the Images tree and produces:

  • counts

  • convertible totals

  • rough space saving estimates

  • planning hints per profile

Outputs:

  • lb_audit.json

  • lb_audit.csv

[1] Build Thumbnails

Creates/updates the precache under:

  • LaunchBox\Images\_Precache\...

Profiles:

  • Fast

  • Balanced

  • Extreme

  • Custom

Notes:

  • If cwebp.exe is present, WebP is used (best compression).

  • You can force JPEG-only (optional).

[2] Activate Precache (junction swap)

“Turns it on.”

  • Moves originals to Images\_Originals\...

  • Creates junctions under Images\... pointing to _Precache

[3] Restore Originals

Undoes Activate:

  • removes junctions

  • moves originals back from _Originals

[4] Clean XML references

Advanced/optional cleanup for broken image refs linked to _BadImages.

[5] Backfill missing precache from Images

Fills only what’s missing:

  • finds originals without corresponding precache output

  • generates precache copies only for those

[6] Rebuild existing precache at new profile

Re-encodes existing precache using a different profile (only replaces when beneficial, depending on settings).

[B] Batch run-all (50,000 cap per session)

This is for huge libraries with hundreds+ platforms/folders.

What it does:

  • Iterates through platform folders under Images

  • Processes them in segments capped at 50,000 per batch session

  • Writes output into: Images\_Precache\<Platform>\...

  • Can resume where it left off in later runs using a state file

Behavior:

  • Prompts per platform with an auto-default (so you can run unattended)

  • Designed so you can run overnight without bogging down the machine for days in one “run all”

Batch state:

  • LaunchBoxRoot\LPM-Batch-State.json (resume point / continuation)

Batch summary:

  • Writes short progress summaries to the LaunchBox root (easy to find)

Also:

  • Batch runs can clear standby cache automatically (admin required) before segments to reduce cache thrash.

[R] Repeat last build (use saved answers)

Re-runs your last answered configuration using:

  • LPM-Answers-Last.json

This is the “do exactly what I did last time” option.

[T] Clean LPM temp files (optional)

Cleans LPM temporary working files (typically under Windows %TEMP% related to LPM processing).
This is safe housekeeping and does not change your LaunchBox Images content.


Notes about WebP + LaunchBox

LaunchBox can display WebP files when they’re in place in the Images tree, but:

  • Drag/drop and scraping workflows typically expect PNG/JPG sources.

  • LPM’s approach keeps originals safe, while precache improves performance.

Clear Logos:

  • PNG sources are strongly recommended (transparency matters).


Recommendation for first-time users

  1. Run Audit

  2. Run Build Thumbnails with Balanced

  3. Test LaunchBox/Big Box performance

  4. Then consider Activate Precache


Support / community

Let me know below if anything doesn't work, or suggestions for future improvement.

If you like this and want to help me out, buy me a coffee:
https://buymeacoffee.com/mcflylpm

  • Thanks 2
  • Unusual Gem 1

User Feedback

Recommended Comments

-McFly-

Posted

This is still in Beta. I've been working on this for a few weeks now, let me know if you find any bugs so I can squash 'em please. Use this at your own risk though, you know the deal with beta software... I'm not responsible if this breaks your setup. 

  • Unusual Gem 1
-McFly-

Posted (edited)

I'm waiting for a new rig for my arcade, this is on hold until I get it. Expect an update in about 2 weeks. (update - i went back to this a little early as I found some time)

Edited by -McFly-
  • Like 1
  • Thanks 2
-McFly-

Posted

Working on the first release right now. If you've tried this already and want something added or changed, let me know so I can include it.

  • Like 1
  • Unusual Gem 1
PSYCHO_SEAN

Posted

I've tried this but I'm struggling with the instructions. I just did for a single platform (playstation). I can see the precache directory is made and populated correctly. But, it's not working in bigbox. No images for playstation games. Did I miss a step? I did the activate precache. Any steps required after this in the prog or in bigbox ?

-McFly-

Posted (edited)

Can you give me 2 screenshots:


LaunchBox\Images\Sony PlayStation folder properties (or dir /AL output)

The exact platform name shown in LaunchBox (Tools → Manage Platforms)

That should help point me in the right direction.

Edited by -McFly-
  • Like 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Add a comment...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...