RCT2 Launch Patch (Unofficial)

The following is a script that I wrote to validate a registry setting before launching RCT2. Hopefully some of you can benefit from this. Copy and paste the code below into Notepad and name it something like "rct2_launcher.bat", the ".bat" is required, and save it to your Desktop or somewhere. Please note that when saving you should select "All Files" from the "Save as Type" drop-down and "ASCII" from the "Encoding" drop-down. The all you have to do is double click the newly created file.

rct2_launcher.bat @echo off rem ########### rem # Author: Andrew Sohn  rem # Date: 2011-10-08 rem # File: rct2_launcher.bat rem # Version: 0.1 rem # Purpose: rem #  This is a launcher for RollerCoaster Tycoon 2 that fixes that darn error if you happen rem #  to put the CD into the wrong optical drive or maybe the labels on your mounted hardware rem #  have changed since you installed the game. rem #  This script determines the volume label of the optical drive (actually, this will probably  rem #   work with no-cd-hacks and virtual drives as well) containing your RollerCoaster Tycoon 2 rem #  CD and then checks to make sure the proper value is in the registry. After all that magic rem #  it will/should launch the game for you by looking at other fancy registry values. rem #  This script will effectively serve as a drop-in-replacement for the shortcut that you use rem #  to launch RollerCoaster Tycoon 2. rem #  This script will not catch the error if the game is launch via AutoPlay. rem # Legal Disclaimer: rem #  No warranty. Use at your own discretion. I tested it pretty thoroughly. rem #  There are checks for everything that could possibly go wrong but just in case I  rem #   have overlooked something or something goes wrong don't worry it is fixable without rem #  the need to reinstall. Feel free to contact me at the e-mail address above with any rem #  questions, concerns, or praises. rem #  This will not void your warranty or change the game experience in ANY way. rem #  This script was developed independently and I have no affiliation with the manufacturer rem #  of the game or any of their affiliates. rem #  Tested on WinXP using RCT2TTP* (but it should work for all versions of RCT2) rem #  *RollerCoaster Tycoon 2 Triple Thrill Pack is one of the best games ever. rem ########### setlocal enabledelayedexpansion for /f "usebackq tokens=1" %%i in (`mountvol ^| find ":\"`) do (   fsutil fsinfo drivetype %%i | find "-ROM" > nul    if not errorlevel 1 ( if exist %%i"rct2.ico" (       set CDROM=%%i        set CDROM=!CDROM:~0,2!        reg query "HKLM\SOFTWARE\Infogrames\RollerCoaster Tycoon 2 Setup" /v SetupPath | findstr "REG_SZ..*!CDROM!" > nul        if errorlevel 1 ( reg add  "HKLM\SOFTWARE\Infogrames\RollerCoaster Tycoon 2 Setup" /v SetupPath /d !CDROM! /f > nul reg query "HKLM\SOFTWARE\Infogrames\RollerCoaster Tycoon 2 Setup" /v SetupPath | findstr "REG_SZ..*!CDROM!" > nul if errorlevel 1 (           echo.Failed to edit registry value for SetupPath            goto die          ) )       goto find_exe_path      ) ) )  echo.Could not find CD for RollerCoaster Tycoon 2 goto die :find_exe_path reg query "HKLM\SOFTWARE\Infogrames\RollerCoaster Tycoon 2 Setup" /v Path | find "REG_SZ" > nul if not errorlevel 1 (   for /f "usebackq tokens=1 delims=Z" %%i in (`reg query "HKLM\SOFTWARE\Infogrames\RollerCoaster Tycoon 2 Setup" /v Path ^| find "REG_SZ"`) do (set prefix=%%i)    for /f "usebackq tokens=1 delims="  %%i in (`reg query "HKLM\SOFTWARE\Infogrames\RollerCoaster Tycoon 2 Setup" /v Path ^| find "REG_SZ"`) do ( set exe_path=%%i call set exe_path=%%exe_path:!prefix!=%% set exe_path=!exe_path:~2! goto find_exe ) )  echo.Could not determine path to RollerCoaster Tycoon 2 executable goto die :find_exe reg query "HKLM\SOFTWARE\Infogrames\RollerCoaster Tycoon 2 Setup" /v Executable | find "REG_SZ" > nul if not errorlevel 1 (   for /f "usebackq tokens=1 delims=Z" %%i in (`reg query "HKLM\SOFTWARE\Infogrames\RollerCoaster Tycoon 2 Setup" /v Executable  ^| find "REG_SZ"`) do (set prefix=%%i)    for /f "usebackq tokens=1 delims="  %%i in (`reg query "HKLM\SOFTWARE\Infogrames\RollerCoaster Tycoon 2 Setup" /v Executable  ^| find "REG_SZ"`) do ( set exe=%%i call set exe=%%exe:!prefix!=%% set exe=!exe:~2! goto launch_game ) )  echo.Could not determine name of RollerCoaster Tycoon 2 executable goto die :launch_game if exist "!exe_path!\!exe!" (   !exe_path!\!exe!    goto eof  ) echo.Could not find file: !exe_path!\!exe! goto die :die echo. pause exit :eof