Guest User

UFS2 - Saves Backup Script

a guest
Dec 9th, 2023
214
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. @echo off
  2. :: Check for administrative privileges
  3. net session >nul 2>&1
  4. if %errorlevel% neq 0 (
  5. echo Requesting administrative privileges...
  6. goto UACPrompt
  7. ) else (
  8. goto main
  9. )
  10.  
  11. :UACPrompt
  12. echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
  13. echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
  14. "%temp%\getadmin.vbs"
  15. exit /B
  16.  
  17. :main
  18. setlocal enabledelayedexpansion
  19.  
  20. :exportAppData
  21. set "backupPath=%UserProfile%\AppData\LocalLow\MasterCode\Ultimate Fishing Simulator 2\_backup"
  22. if not exist "!backupPath!" mkdir "!backupPath!"
  23.  
  24. rem Get current date and time in a format suitable for file naming
  25. for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a"
  26. set "YYYY=%dt:~0,4%"
  27. set "MM=%dt:~4,2%"
  28. set "DD=%dt:~6,2%"
  29. set "HH=%dt:~8,2%"
  30. set "Min=%dt:~10,2%"
  31. set "Sec=%dt:~12,2%"
  32. set "timestamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%"
  33.  
  34. reg export "HKEY_CURRENT_USER\Software\MasterCode\Ultimate Fishing Simulator 2" "!backupPath!\UFS2-Registry-Backup_%timestamp%.reg"
  35. echo Registry export complete in AppData LocalLow!
  36.  
  37. :endScript
  38. echo Exiting...
  39. exit
Advertisement
Add Comment
Please, Sign In to add comment