|
Dim objHTA, cClipboard, WshShell |
|
Set objHTA = createobject("htmlfile") |
|
cClipboard = objHTA.parentwindow.clipboarddata.getdata("text") |
|
|
|
Set WshShell = WScript.CreateObject("WScript.Shell") |
|
Dim MyKey |
|
|
|
If isRegPath(cClipboard,cClipboard) Then |
|
MyKey = Inputbox("Navigate to this Registry path", "Go to reg key...", cClipboard) |
|
Else |
|
MyKey = Inputbox("Type the Registry path", "Go to reg key...") |
|
End If |
|
|
|
If IsEmpty(MyKey) Then |
|
'Cancelled |
|
Else |
|
Call isRegPath(MyKey,MyKey) |
|
MyKey = "Computer\" & MyKey |
|
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey", MyKey, "REG_SZ" |
|
WshShell.Run "regedit.exe -m" |
|
End If |
|
|
|
Set objHTA = nothing |
|
Set WshShell = nothing |
|
|
|
Function isRegPath(sString,fString) |
|
If IsNull(sString) Then |
|
sString = "" |
|
End If |
|
isRegPath = False |
|
Dim oRegExp, patterns, replacements, item, i, aMatches, match, bFound |
|
patterns = Array("HKEY_", "HKCU:?\\", "HKLM:?\\", "HKU:?\\", "HKCC:?\\", "HKCR:?\\") |
|
replacements = Array("HKEY_", "HKEY_CURRENT_USER\", "HKEY_LOCAL_MACHINE\", "HKEY_USERS\", "HKEY_CURRENT_CONFIG\", "HKEY_CLASSES_ROOT\") |
|
Set oRegExp = New RegExp |
|
oRegExp.IgnoreCase = True |
|
oRegExp.Global = True |
|
Set trailingslash = New RegExp |
|
trailingslash.Pattern = "\\$" |
|
trailingslash.Global = true |
|
|
|
i = 0 |
|
For Each item In patterns |
|
oRegExp.Pattern = item |
|
Set aMatches = oRegExp.Execute(sString) |
|
bFound = False |
|
|
|
For Each match In aMatches |
|
bFound = True |
|
fString = Replace(fString, vbCr, "") |
|
fString = Replace(fString, vbLf, "") |
|
fString = Replace(fString, chr(34), "") |
|
fString = Trim(fString) |
|
fString = trailingslash.Replace(fString, "") |
|
fString = Replace(fString, match, replacements(i)) |
|
Exit For |
|
Next |
|
i = i+1 |
|
|
|
If bFound Then |
|
isRegPath = True |
|
Exit For |
|
Else |
|
isRegPath = False |
|
End If |
|
Next |
|
End Function |
@akaleeroy
Hello. Are you still available and alive on github?
I thought to go back to the Go to registry key topic and try to update it for the latest windows 10 and 11 to make it work as well.
Let me know what you think if you see this message.