- Published on •
Building a mod toggler for Red Dead Redemption 2
- Authors
- Name
- Liliana Summers
Remember when playing modded games meant just installing everything and forgetting about it? Yeah, me neither. In the modern gaming world, managing mods has become a delicate balancing act, especially when you want to switch between a heavily modded single-player experience and an online mode that requires vanilla files. Such is the life of a Red Dead Redemption 2 player who enjoys both Arthur Morgan's story and the occasional online showdown with friends. But constantly shuffling dozens of mod files between directories? That's where I draw the line.

The Problem: A Wild West of File Management
The issue is simple but tedious: RDR2's story mode is a perfect canvas for mods that enhance graphics, gameplay, and immersion. But if you try to jump into Red Dead Online with those same mods active, at best, you'll get an error message. At worst, you might get banned. (And nobody wants to explain to Rockstar Support your questionable mod choices.)
The conventional approach is painfully manual:
- Navigate to your RDR2 installation folder
- Select all mod files and folders
- Cut them
- Paste them into a backup folder
- Launch RDO When you want to play story mode again, reverse the entire process
After doing this dance a few dozen times, I realized I was spending more time moving files than actually playing the game. As someone who firmly believes that repetitive tasks are what computers were invented to solve, I decided it was time for automation.
The Solution: Batch Script Magic
The answer came in the form of an old but reliable friend: the Windows batch script. While PowerShell might offer more bells and whistles, there's something satisfying about solving a problem with technology that's been around since DOS was cool. Plus, batch scripts are lightweight, requiring no additional installations or dependencies.
Here's what I wanted my script to do:
- Automatically detect whether mods are currently active
- Move all mod files and folders to a backup location when switching to Online
- Restore all those files when returning to Story Mode
- Work with a single click
- Create shortcuts for launching the appropriate game mode
The Evolution of the Script
Version 1: The Basic Functionality
The first version was bare-bones: a simple script that would move files from point A to point B and back again. It worked, but it wasn't particularly smart or user-friendly.
@echo off
set "RDR2_FOLDER=C:\Program Files\Steam\steamapps\common\Red Dead Redemption 2"
set "MODS_BACKUP=C:\RDR2_Mods_Backup"
// remove files between folders based on a flag file...
Version 2: Adding Configuration and UI
The next version added a configuration file to make it easier to customize which mod files and folders were tracked. I also added some basic UI elements with color-coding to make it more user-friendly. This is where things got interesting – and by "interesting," I mean "confusingly stuck in a loop recreating the config file." I had implemented a config file system where the script would store the paths and lists of mod files, but there was a subtle bug in how the script detected whether the config file existed.
if not exist "%MODS_BACKUP%\config.ini" (
echo Creating configuration file...
if not exist "%MODS_BACKUP%" mkdir "%MODS_BACKUP%"
(
echo RDR2_FOLDER=%RDR2_FOLDER%
echo MODS_BACKUP=%MODS_BACKUP%
echo.
echo # Add mod files below (comma-separated)
echo MOD_FILES=lml.asi,dinput8.dll,ScriptHookRDR2.dll
echo.
echo # Add mod folders below (comma-separated)
echo MOD_FOLDERS=scripts,mods
) > "%MODS_BACKUP%\config.ini"
)
The issue? A subtle path handling problem that caused the script to perpetually think the config file didn't exist, even after creating it. This led to an infinite loop of "creating" a config file that was never recognized.
Version 3: The Simplified Approach
After wrestling with the config file approach, I took a step back and realized I was overcomplicating things. The most elegant solution turned out to be the simplest: hardcode the mod files and folders directly in the script and focus on making the core functionality rock-solid.
set "MOD_FILES=asiloader.log dinput8.dll dlsstweaks.ini dlsstweaks.log DLSSTweaksConfig.exe EasyHook.dll EasyHook.log EasyHook64.dll EasyHookPatch.asi EasyLoad64.dll EnableNvidiaSigOverride.reg GraphicsYTDFix.asi GunTricks.asi horseLantern.asi IgcsConnector.addon64 IgcsConnector.ini LennysSimpleTrainer.log lml.ini ModManager.Core.dll ModManager.log ModManager.NativeInterop.dll NativeInterop.dll NLog.dll nvngx.dll outfitchanger.ini PhotoModeEnhancer.asi Rampage.asi RDR2_Enhanced_Edition_2025.ini ReShade.ini ReShade.log ReShadePreset.ini ScriptHookRDR2.dll ScriptHookRDR2.log SimpleHook.dll version.dll vfs.asi vfs.log"
set "MOD_FOLDERS=LennysSimpleTrainer lml RampageFiles reshade-shaders"
This approach was not just more reliable – it was also easier to maintain. If I installed a new mod, I could simply edit the script directly rather than dealing with a separate configuration file.
Version 4: Smart Restoration
The final improvement was to make the script smarter about restoring files. Instead of blindly moving files back and forth every time, it now checks which files are missing and only restores those. This makes switching from Online to Story mode much faster, especially for large mod folders.
:: Check mod files in game directory and only restore if they're missing
set "RESTORED_FILES=0"
for %%f in (%MOD_FILES%) do (
if exist "%MODS_BACKUP%\%%f" (
if not exist "%RDR2_FOLDER%\%%f" (
echo Restoring %%f...
move /Y "%MODS_BACKUP%\%%f" "%RDR2_FOLDER%\%%f"
set /a "RESTORED_FILES+=1"
)
)
)
This optimization cut down the restoration time dramatically, especially for the larger mod folders that could take a minute or more to copy.
The Final Product
The end result is a script that:
- Presents a simple menu for enabling/disabling mods
- Efficiently moves files only when necessary
- Creates convenient shortcuts for launching each game mode
- Detects when Steam is running and warns you (to prevent file access issues)
- Provides clear feedback about what it's doing
@echo off
setlocal
:: Paths
set "RDR2_FOLDER=D:\Program Files\Steam\steamapps\common\Red Dead Redemption 2"
set "MODS_BACKUP=G:\Games\RDR2\mods_backup"
:: File lists
set "MOD_FILES=asiloader.log dinput8.dll dlsstweaks.ini dlsstweaks.log DLSSTweaksConfig.exe..."
set "MOD_FOLDERS=LennysSimpleTrainer lml RampageFiles reshade-shaders"
title RDR2 Mod Toggler
echo =========================================
echo RDR2 Mod Toggler v3.1
echo =========================================
echo.
:: Menu and logic follows...
What I Learned
This project reminded me of several important development lessons:
- Simplicity wins: My first instinct was to over-engineer the solution with a complex configuration system. The most reliable solution turned out to be the simplest.
- Output matters: Adding clear, informative output messages made debugging much easier and improved the user experience.
- Optimize for the common case: The intelligent restore logic dramatically improved performance by recognizing that most of the time, only a few files need to be moved.
- Test in the real world: What worked perfectly in testing sometimes failed in actual usage, particularly around path handling and file permissions.
The Bigger Picture
This project is a small example of a broader philosophy: automation should serve real needs. The best scripts aren't necessarily the most technically impressive – they're the ones that save you time and frustration in your day-to-day life. RDR2 Mod Toggler isn't going to win any awards for technical innovation, but it solves a real problem that was actively reducing my enjoyment of a game I love. Now, switching between story mode and online play is a one-click operation, letting me focus on what matters: playing the game.
TLDR
I built a batch script that automatically moves Red Dead Redemption 2 mod files between my game folder and a backup location. This lets me quickly switch between a modded single-player experience and a clean installation for Red Dead Online.
The script:
- Shows a simple menu to enable/disable mods
- Only moves files that actually need to be moved (for better performance)
- Creates desktop shortcuts for launching each game mode
- Warns you if Steam is running (which can cause file access issues)
And most importantly, it saves me from the tedium of manually moving dozens of files every time I want to switch game modes. Because life is too short to spend it cutting and pasting files when you could be robbing trains in the Old West.
Want to implement this for your own RDR2 setup? The full script is available on my GitHub repository. Feel free to fork it, improve it, or adapt it for other games that have similar mod management challenges.
Comments
You must be signed in to comment or reply.
It's very quiet here 👻
Join the Discussion
To contribute to the discussion, we need to verify your email. We'll send you a one-time password to confirm your address. Once verified, you'll be able to post comments.
Only your name will be displayed with your comments and can be updated each time you sign in.