scite-ru /pack/tools/RegJump.js

Language Javascript Lines 47
MD5 Hash 70de9dd18a3008a258a10802acf96d1d
Repository http://scite-ru.googlecode.com/svn/trunk/ View Raw File
| Open JSFiddle
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
Registry Jump
Version: 1.3
Author: mozers™
------------------------------------------------
????????? ?????????? ????? ? ????????? ???????
???????? ?????? ????:
  HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control
  HKLM\SYSTEM\CurrentControlSet\Control
  HKLM\\SYSTEM\\CurrentControlSet\\Control
???????????:
command.name.78.*=Registry Jump
command.78.*=wscript "$(SciteDefaultHome)\tools\RegJump.js"
command.input.78.*=$(CurrentSelection)
command.mode.78.*=subsystem:windows,replaceselection:no,savebefore:no,quiet:yes
command.shortcut.78.*=Ctrl+Alt+J
*/

function TaskKill (process_name){
	var objWMIService = GetObject("winmgmts:\\\\.\\root\\CIMV2");
	var colProcessList = objWMIService.ExecQuery ('SELECT * FROM Win32_Process WHERE NAME = "' + process_name + '"');
	var enumItems = new Enumerator(colProcessList);
	for (; !enumItems.atEnd(); enumItems.moveNext()){
		enumItems.item().Terminate();
	}
}

var key = WScript.StdIn.ReadAll();
if (key === "") {
	WScript.Quit();
}
var WshShell = new ActiveXObject("WScript.Shell");

var LastKey = 'HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit\\Lastkey';
key = key.replace(/^HKLM\\/,'HKEY_LOCAL_MACHINE\\');
key = key.replace(/^HKCR\\/,'HKEY_CLASSES_ROOT\\');
key = key.replace(/^HKCU\\/,'HKEY_CURRENT_USER\\');
key = key.replace(/\\\\/g,'\\');
key = WshShell.RegRead(LastKey).match(/^[^\\]+/) + '\\' + key;

TaskKill ("regedit.exe");

WshShell.RegWrite (LastKey, key,'REG_SZ');
WshShell.Run('regedit', 1, false);
WScript.Quit();
Back to Top