Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- :: SBE
- :: Copy all text into a file, and "Save As" SBE.bat
- :: The name isn't important, but it MUST end with ".bat". If you're using Notepad, select "All Files" under "File Type" on the Save As window.
- title Sam's Backup Engine for CUE (v0.2)
- color f0
- echo off
- set BACKUPDIR=%USERPROFILE%\Documents\Corsair\CUE\Backup
- set CORSAIRDIR=%APPDATA%\Corsair\CUE
- :: Check system architecture and set the CUE.exe file location accordingly
- if %PROCESSOR_ARCHITECTURE%==x86 (
- :: 32 bit
- set CORSAIRPROGRAMFILE="C:\Program Files\Corsair\Corsair Utility Engine\CUE.exe"
- ) else (
- :: 64 bit
- set CORSAIRPROGRAMFILE="C:\Program Files (x86)\Corsair\Corsair Utility Engine\CUE.exe"
- )
- :: Avoid starting CUE in case we want to restore
- goto menu
- :: Block to start CUE [not working as it should, todo: fix]
- :startcue
- cls
- echo Starting CUE...
- call %CORSAIRPROGRAMFILE%
- goto menu
- :: Main menu block
- :menu
- cls
- echo Choose an option...
- echo.
- echo [1] Backup your settings
- echo [2] Restore your settings
- ::echo [3] Start CUE
- set /p n=
- if %n% == 1 goto backupprompt
- if %n% == 2 goto restoreprompt
- ::if %n% == 3 goto startcue
- goto menu
- :: Backup prompt block
- :backupprompt
- cls
- echo Are you sure? This will wipe your current backup and replace it with a new one.
- echo Make sure your profiles are working before continuing!
- echo [1] Continue
- echo [2] Cancel and go to menu
- set /p ahs=
- if %ahs% == 1 goto backup
- if %ahs% == 2 goto menu
- goto backupprompt
- :: Backup block - holds the actual code to copy files
- :backup
- cls
- if NOT EXIST %BACKUPDIR% mkdir %BACKUPDIR% && echo Created backup folder.
- timeout /t 2 /nobreak >nul
- cls
- echo Deleting old backup...
- del /Q %BACKUPDIR%
- if errorlevel 1 goto fail
- if errorlevel 0 echo Success
- echo Copying new settings...
- xcopy /S /Y %CORSAIRDIR% %BACKUPDIR%
- if errorlevel 1 goto fail
- if errorlevel 0 echo Success
- echo.
- echo --------
- echo.
- echo All done! Return to menu by pressing any key.
- pause >nul
- goto menu
- :restoreprompt
- cls
- echo Are you sure? This will wipe your profiles and replace them with the backed-up settings.
- echo !! WARNING: Make sure CUE is properly closed before continuing !!
- echo [1] Continue
- echo [2] Cancel and go to menu
- set /p ays=
- if %ays% == 1 goto restore
- if %ays% == 2 goto menu
- goto restoreprompt
- :restore
- cls
- echo Checking for backups...
- if NOT EXIST %BACKUPDIR% goto faildir
- echo Deleting old settings...
- del /Q %CORSAIRDIR%
- if errorlevel 1 goto fail
- if errorlevel 0 echo Success
- echo Copying new settings...
- xcopy /S /Y %BACKUPDIR% %CORSAIRDIR%
- if errorlevel 1 goto fail
- if errorlevel 0 echo Success
- echo.
- echo --------
- echo.
- echo All done! Return to menu by pressing any key.
- pause >nul
- goto menu
- :fail
- echo.
- echo --------
- echo.
- echo SBE failed to run. See log above for more information.
- pause
- goto menu
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement