SHARE
TWEET

backupper_savekey

a guest Apr 1st, 2018 177 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @echo off
  2.  
  3. if "%PROCESSOR_ARCHITECTURE%" neq "AMD64" (
  4.   echo Dieses Script funktioniert z.Zt. nur auf einem 64-bit Betriebssystem.
  5.   echo Anpassung der Pfade notwendig!
  6.   echo.
  7.   pause
  8.   exit /b
  9. )
  10.  
  11. reg query "HKU\S-1-5-19" >nul 2>&1 || (
  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.   del "%temp%\getadmin.vbs" >nul 2>&1
  16.   exit /b
  17. )
  18.  
  19. set regkey=HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion
  20. set regvalue=ProgramData
  21. set regfile=backupper_reg.reg
  22. set regfile2=backupper_regfile.bin
  23. set restore=backupper_restore.bat
  24.  
  25. reg query %regkey% /v %regvalue% | findstr /i "%regvalue%" >"%~dp0%regfile%"
  26. set /p tmp=<"%~dp0%regfile%"
  27. set tmp=%tmp:~33%
  28. set reghex=
  29.  
  30. :loop
  31. set reghex=%reghex%%tmp:~0,2%,
  32. set tmp=%tmp:~2%
  33. if "%tmp%" neq "" goto loop
  34.  
  35. echo Windows Registry Editor Version 5.00>"%~dp0%regfile%"
  36. echo.>>"%~dp0%regfile%"
  37. echo [%regkey%]>>"%~dp0%regfile%"
  38. echo "%regvalue%"=hex:%reghex:~0,-1%>>"%~dp0%regfile%"
  39.  
  40. copy C:\Windows\SysWOW64\winsevr.dat "%~dp0%regfile2%" /y >nul 2>&1
  41.  
  42. echo @echo off>"%~dp0%restore%"
  43. echo.>>"%~dp0%restore%"
  44. echo reg query "HKU\S-1-5-19" ^>nul 2^>^&1 ^|^| ( >>"%~dp0%restore%"
  45. echo   echo Set UAC = CreateObject^^("Shell.Application"^^) ^> "%%temp%%\getadmin.vbs" >>"%~dp0%restore%"
  46. echo   echo UAC.ShellExecute "%%~s0", "", "", "runas", 1 ^>^> "%%temp%%\getadmin.vbs" >>"%~dp0%restore%"
  47. echo   "%%temp%%\getadmin.vbs" >>"%~dp0%restore%"
  48. echo   del "%%temp%%\getadmin.vbs" ^>nul 2^>^&1 >>"%~dp0%restore%"
  49. echo   exit /b >>"%~dp0%restore%"
  50. echo ) >>"%~dp0%restore%"
  51. echo. >>"%~dp0%restore%"
  52. echo reg import "%%~dp0%regfile%" >>"%~dp0%restore%"
  53. echo copy "%%~dp0%regfile2%" "C:\Windows\SysWOW64\winsevr.dat" >>"%~dp0%restore%"
  54. echo copy "%%~dp0%regfile2%" "C:\Program Files (x86)\AOMEI Backupper\AmCore.dll" >>"%~dp0%restore%"
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top