Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @echo off
- :: Check for administrative privileges
- net session >nul 2>&1
- if %errorlevel% neq 0 (
- echo Requesting administrative privileges...
- goto UACPrompt
- ) else (
- goto main
- )
- :UACPrompt
- echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
- echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
- "%temp%\getadmin.vbs"
- exit /B
- :main
- setlocal enabledelayedexpansion
- :exportAppData
- set "backupPath=%UserProfile%\AppData\LocalLow\MasterCode\Ultimate Fishing Simulator 2\_backup"
- if not exist "!backupPath!" mkdir "!backupPath!"
- rem Get current date and time in a format suitable for file naming
- for /f "delims=" %%a in ('wmic OS Get localdatetime ^| find "."') do set "dt=%%a"
- set "YYYY=%dt:~0,4%"
- set "MM=%dt:~4,2%"
- set "DD=%dt:~6,2%"
- set "HH=%dt:~8,2%"
- set "Min=%dt:~10,2%"
- set "Sec=%dt:~12,2%"
- set "timestamp=%YYYY%-%MM%-%DD%_%HH%-%Min%-%Sec%"
- reg export "HKEY_CURRENT_USER\Software\MasterCode\Ultimate Fishing Simulator 2" "!backupPath!\UFS2-Registry-Backup_%timestamp%.reg"
- echo Registry export complete in AppData LocalLow!
- :endScript
- echo Exiting...
- exit
Advertisement
Add Comment
Please, Sign In to add comment