PageRenderTime 66ms CodeModel.GetById 34ms RepoModel.GetById 0ms app.codeStats 0ms

/pack/tools/RegJump.js

http://scite-ru.googlecode.com/
JavaScript | 46 lines | 23 code | 6 blank | 17 comment | 2 complexity | 70de9dd18a3008a258a10802acf96d1d MD5 | raw file
Possible License(s): 0BSD
  1. /*
  2. Registry Jump
  3. Version: 1.3
  4. Author: mozers™
  5. ------------------------------------------------
  6. ????????? ?????????? ????? ? ????????? ???????
  7. ???????? ?????? ????:
  8. HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
  9. HKLM\SYSTEM\CurrentControlSet\Control
  10. HKLM\\SYSTEM\\CurrentControlSet\\Control
  11. ???????????:
  12. command.name.78.*=Registry Jump
  13. command.78.*=wscript "$(SciteDefaultHome)\tools\RegJump.js"
  14. command.input.78.*=$(CurrentSelection)
  15. command.mode.78.*=subsystem:windows,replaceselection:no,savebefore:no,quiet:yes
  16. command.shortcut.78.*=Ctrl+Alt+J
  17. */
  18. function TaskKill (process_name){
  19. var objWMIService = GetObject("winmgmts:\\\\.\\root\\CIMV2");
  20. var colProcessList = objWMIService.ExecQuery ('SELECT * FROM Win32_Process WHERE NAME = "' + process_name + '"');
  21. var enumItems = new Enumerator(colProcessList);
  22. for (; !enumItems.atEnd(); enumItems.moveNext()){
  23. enumItems.item().Terminate();
  24. }
  25. }
  26. var key = WScript.StdIn.ReadAll();
  27. if (key === "") {
  28. WScript.Quit();
  29. }
  30. var WshShell = new ActiveXObject("WScript.Shell");
  31. var LastKey = 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit\\Lastkey';
  32. key = key.replace(/^HKLM\\/,'HKEY_LOCAL_MACHINE\\');
  33. key = key.replace(/^HKCR\\/,'HKEY_CLASSES_ROOT\\');
  34. key = key.replace(/^HKCU\\/,'HKEY_CURRENT_USER\\');
  35. key = key.replace(/\\\\/g,'\\');
  36. key = WshShell.RegRead(LastKey).match(/^[^\\]+/) + '\\' + key;
  37. TaskKill ("regedit.exe");
  38. WshShell.RegWrite (LastKey, key,'REG_SZ');
  39. WshShell.Run('regedit', 1, false);
  40. WScript.Quit();