Jump to content



Photo
- - - - -

Virtual Pinball Backup Scripts 2026


  • Please log in to reply
No replies to this topic

#1 Tesla

Tesla

    Pinball Fan

  • Silver Supporter
  • 1,503 posts
  • Location:Texas, USA

  • Flag: United States of America

  • Favorite Pinball: Star Trek - TNG

Posted Today, 04:46 PM

These file are for backing-up and protecting our Virtual-Pinball computers and programs (including Visual Pinball, VPX, and other programs).
I've put a lot of time into my 3-screen VPX cabinet, getting everything properly adjusted and working near 100%. Now that I am approaching 50 Tables,
I'm enjoying less tweaking, and more "just playing it" time for me and the family.
 
You should be able to place and run these batch-file scripts from where-ever you want, but I like to place them like this.
An empty folder can hold the batch-file you run and the dated folder it creates. I tend to run one (and let it finish) and then the other (and store as a set).
 
C:\VP-BAK\
-
-  C:\VP-BAK\CFG\
-  -   VP-BAK-CFG.bat
-
-  C:\VP-BAK\FILES\
-  -   VP-BAK-FILES.bat
- 
--------------------
 
VP-BAK-CFG.bat
 
This is mostly Windows Registry exports, but also a few config-files. This is good for later possible migrations to a new computer.
Also good for rebuilding a clean-install (instead of starting from scratch).
 
Features and Recent Changes:
- This is mostly still @Fhjui original work 
- Due to recent depreciation/removal of wmic command from Windows-11, @Fhjui has re-coded his dated folder creation routine.
 
REM Fhjui's Backup of the most important Registry-Keys for Vpin-software and Config export v2.0
REM All keys are from the User-hive HKCU, they are valid for the just logged-in user

@echo off

REM system language independent use of date/time
for /f "tokens=1,2 delims==" %%a in ('powershell -NoProfile -Command "$d=Get-Date; 'Year='+$d.Year; 'Month='+$d.Month; 'Day='+$d.Day; 'Hour='+$d.Hour; 'Minute='+$d.Minute; 'Second='+$d.Second"') do set %%a=%%b
REM Format that leading "0" will be added, if necessary
if "%Month:~1,1%"==""   set Month=0%Month%
if "%Day:~1,1%"==""     set Day=0%Day%
if "%Hour:~1,1%"==""    set Hour=0%Hour%
if "%Minute:~1,1%"==""  set Minute=0%Minute%
if "%Second:~1,1%"==""  set Second=0%Second%

REM build date and time-string: YYYY-MM-DD_HH-MM-SS
set MYDATE=%Year%.%Month%.%Day%
set MYTIME=%Hour%-%Minute%-%Second%
set DateTime=%MYDATE%_%MYTIME%

REM every time a new directory is created for the exported keys and log files
mkdir %DateTime%

start /wait reg export HKCU\SOFTWARE\DirectOutput %DateTime%\DirectOutput.reg /Y
start /wait reg export HKCU\SOFTWARE\DOFLinx %DateTime%\DOFLinx.reg /Y
start /wait reg export "HKCU\SOFTWARE\Future Pinball" %DateTime%\FuturePinball.reg /y
start /wait reg export HKCU\SOFTWARE\Freeware %DateTime%\VPinMAME.reg /y
start /wait reg export HKCU\SOFTWARE\PinUPPopper %DateTime%\PinUPPopper.reg /y
start /wait reg export HKCU\SOFTWARE\UltraDMD %DateTime%\UltraDMD.reg /y
start /wait reg export HKCU\SOFTWARE\Valve %DateTime%\Steam.reg /y
start /wait reg export "HKCU\SOFTWARE\Visual Pinball" %DateTime%\VisualPinball.reg /y

start /wait reg export HKEY_CLASSES_ROOT\CLSID\{A23BFDBC-9A8A-46C0-8672-60F23D54FFB6} %DateTime%\DOF-object-registration_HKCR.reg /Y
start /wait reg export HKEY_CLASSES_ROOT\WOW6432Node\CLSID\{A23BFDBC-9A8A-46C0-8672-60F23D54FFB6} %DateTime%\DOF-object-registration_WOW6432.reg /y

REM save VPinballX.ini
copy %APPDATA%\VPinballX\VPinballX.ini %DateTime%\VPinballX.ini
copy %APPDATA%\VPinballX\BAMViewSettings.xml %DateTime%\BAMViewSettings.xml

echo ALL DONE !
pause

 
VP-BAK-FILES.bat
 
This one does a straight-file backup of all your VP files (like a full backup of C-Drive, but without the Windows-OS and non-VP files & folders).
I still occasionally run a Macrium-Reflect Full-Backup image-file (with Verify pass) for extra insurance, but this quicker backup facilitates being able to run that less often.
 
Features and Recent Changes:
- It preserves all Time-Stamps and everything gets logged. 
- Includes required special handling of the "Documents" folder (if you want to back that up also).
- Now includes CurrentUser variable (currently logged-in Windows user). So, like the other script, you can now use this on any computer (without changes).
- Now includes copying of PinUPSystem folder.
 
@echo off

echo Backup this computer's most important VPX and Front-End software folders
echo including tables, roms, media assets, as Files v2.1
echo.

REM system language independent use of date/time
for /f "tokens=1,2 delims==" %%a in ('powershell -NoProfile -Command "$d=Get-Date; 'Year='+$d.Year; 'Month='+$d.Month; 'Day='+$d.Day; 'Hour='+$d.Hour; 'Minute='+$d.Minute; 'Second='+$d.Second"') do set %%a=%%b
REM Format that leading "0" will be added, if necessary
if "%Month:~1,1%"==""   set Month=0%Month%
if "%Day:~1,1%"==""     set Day=0%Day%
if "%Hour:~1,1%"==""    set Hour=0%Hour%
if "%Minute:~1,1%"==""  set Minute=0%Minute%
if "%Second:~1,1%"==""  set Second=0%Second%

REM build date and time-string: YYYY-MM-DD_HH-MM-SS
set MYDATE=%Year%.%Month%.%Day%
set MYTIME=%Hour%-%Minute%-%Second%
set DateTime=%MYDATE%_%MYTIME%

REM Set Current-User, Source, and Destination (use no DEST in script for current folder)
SET CurrentUser=%USERNAME%
SET SOURCE=C:
SET DEST=D:

echo Ready to backup a lot of folders and files from %SOURCE%
echo.
echo Press CTRL-C to cancel, or
pause

REM every time a new directory is created for the copied files and folders
REM create it and non-Root Alternates
mkdir %DateTime%
mkdir %DateTime%\z-AppData-VPX-INI
mkdir %DateTime%\z-Users-Docs
timeout /t 3 /nobreak

REM save VPinballX.ini and BAMViewSettings.xml
copy %APPDATA%\VPinballX\VPinballX.ini %DateTime%\z-AppData-VPX-INI\VPinballX.ini
copy %APPDATA%\VPinballX\BAMViewSettings.xml %DateTime%\z-AppData-VPX-INI\BAMViewSettings.xml

REM RobustCopy whole folders from root of SOURCE-Drive (preserve TimeStamps and Log-it)

robocopy "%SOURCE%\B2S-Server" "%DateTime%\B2S-Server" /E /V /TEE /MT:8 /COPY:DAT /DCOPY:DAT /XJD /XJF /LOG+:"%DateTime%\LogFile.txt"
robocopy "%SOURCE%\DirectOutput" "%DateTime%\DirectOutput" /E /V /TEE /MT:8 /COPY:DAT /DCOPY:DAT /XJD /XJF /LOG+:"%DateTime%\LogFile.txt"
robocopy "%SOURCE%\EqualizerAPO" "%DateTime%\EqualizerAPO" /E /V /TEE /MT:8 /COPY:DAT /DCOPY:DAT /XJD /XJF /LOG+:"%DateTime%\LogFile.txt"
robocopy "%SOURCE%\PinballY" "%DateTime%\PinballY" /E /V /TEE /MT:8 /COPY:DAT /DCOPY:DAT /XJD /XJF /LOG+:"%DateTime%\LogFile.txt"
robocopy "%SOURCE%\Pinscape-Tool" "%DateTime%\Pinscape-Tool" /E /V /TEE /MT:8 /COPY:DAT /DCOPY:DAT /XJD /XJF /LOG+:"%DateTime%\LogFile.txt"
robocopy "%SOURCE%\PinUPSystem" "%DateTime%\PinUPSystem" /E /V /TEE /MT:8 /COPY:DAT /DCOPY:DAT /XJD /XJF /LOG+:"%DateTime%\LogFile.txt"
robocopy "%SOURCE%\PinVol" "%DateTime%\PinVol" /E /V /TEE /MT:8 /COPY:DAT /DCOPY:DAT /XJD /XJF /LOG+:"%DateTime%\LogFile.txt"
robocopy "%SOURCE%\Programs" "%DateTime%\Programs" /E /V /TEE /MT:8 /COPY:DAT /DCOPY:DAT /XJD /XJF /LOG+:"%DateTime%\LogFile.txt"

robocopy "%SOURCE%\Visual Pinball" "%DateTime%\Visual Pinball" /E /V /TEE /MT:8 /COPY:DAT /DCOPY:DAT /XJD /XJF /LOG+:"%DateTime%\LogFile.txt"
robocopy "%SOURCE%\VPX80" "%DateTime%\VPX80" /E /V /TEE /MT:8 /COPY:DAT /DCOPY:DAT /XJD /XJF /LOG+:"%DateTime%\LogFile.txt"

robocopy "%SOURCE%\Users\%CurrentUser%\Documents" "%DateTime%\z-Users-Docs" /E /V /TEE /MT:8 /COPY:DAT /DCOPY:DAT /XJD /XJF /LOG+:"%DateTime%\LogFile.txt" /XD "My Games" "WindowsPowerShell" /XF "desktop.ini"

echo ALL DONE !
echo.
echo You can easily find summaries in log by searching day of week
echo.
pause