How does it work? Just input registry key or folder path after script name. Note that script works well on WinXP and has not been tested on higher Win systems. Also you should know that if regedit has been launched then when you trying access another key it always starts with another window of regedit. Explorer has the same behaviour with this script. You can jump to HKCR, HKCU and HKLM branches but if you need more, please edit script manually :) For folders jump you should input full or relative path. For example: jump \doc or jump . or jump E:\fotos
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 | @set @script=0 /*
@echo off
set @script=
cscript //nologo //e:jscript "%~dpnx0" %1
exit /b
*/
with (WScript.Arguments) {
if (length != 1) {
var obj = WScript.ScriptName.split(".")[0];
WScript.echo(obj + " v1.01 - File and registry key quick accessor");
WScript.echo("Copyright (C) 2010-2013 greg zakharov gregzakh@gmail.com");
WScript.echo("\nUsage: " + obj + " <path>");
WScript.echo("e.g.: " + obj + " hklm\\software\\microsoft\\windows");
WScript.echo("e.g.: " + obj + " e:\\src");
WScript.Quit(1);
}
var jmp = Unnamed(0),
key = "HKCU\\Software\\Microsoft\\Windows\\CurrentVersion\\Applets\\Regedit\\LastKey";
try {
with (new ActiveXObject('WScript.Shell')) {
if (jmp.match(/^HK(CR|CU|LM)/i)) {
jmp = jmp.replace(/^HKCR/i, 'HKEY_CLASSES_ROOT');
jmp = jmp.replace(/^HKCU/i, 'HKEY_CURRENT_USER');
jmp = jmp.replace(/^HKLM/i, 'HKEY_LOCAL_MACHINE');
RegWrite(key, jmp, 'REG_SZ');
Run("regedit -m", 1, false);
}
else if (jmp.match(/^([a-z]\:|\.|\\)/i)) {
Run("explorer /n, " + jmp, 1, false);
}
else throw "Invalid data in current context.";
}
}
catch (e) { WScript.echo(e); }
}
|