Advertisement
aveyo

multiregedit_clipboard

May 18th, 2018
1,150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.05 KB | None | 0 0
  1. @echo off & set "root=HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit"
  2. call reg delete "%root:\\=\%" /v LastKey /f >nul
  3. mshta "javascript:window.close(new ActiveXObject('WScript.Shell').RegWrite("%root%\\LastKey",window.clipboardData.getData("Text")||'',"REG_SZ"))" >nul
  4. call :reg_query "%root:\\=\%" LastKey lastkey
  5. if defined lastkey set lastkey=%lastkey:"=%
  6. if defined lastkey set "lastkey=%lastkey:[=%"
  7. if defined lastkey set "lastkey=%lastkey:]=%"
  8. if defined lastkey reg add "%root:\\=\%" /v LastKey /d "%lastkey%" /f >nul
  9. start "w" mshta "javascript:window.close(new ActiveXObject('WScript.Shell').Run('regedit.exe -m', 1, 'False'))"
  10. exit/b
  11. echo off | clip & rem clear clipboard
  12.  
  13. :reg_query %1:KeyName %2:ValueName %3:OutputVariable %4:other_options[example: "/t REG_DWORD"]
  14. setlocal & for /f "skip=2 delims=" %%s in ('reg query "%~1" /v "%~2" /z 2^>nul') do set "rq=%%s" & call set "rv=%%rq:*)    =%%"
  15. endlocal & set "%~3=%rv%" & exit/b                              &rem AveYo - Usage:" call :reg_query "HKCU\MyKey" "MyValue" MyVar "
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement