无忧启动论坛

标题: 注册表跳转VBS脚本,方便操作注册表 [打印本页]

作者: edison_2008    时间: 2025-8-25 18:54
标题: 注册表跳转VBS脚本,方便操作注册表
  1. Option Explicit

  2. Dim objShell, userInput, regPath
  3. Set objShell = CreateObject("WScript.Shell")

  4. ' 获取用户输入的注册表路径
  5. userInput = InputBox("请输入注册表路径(例如:HKEY_LOCAL_MACHINE\SOFTWARE):", "注册表路径跳转工具")

  6. ' 用户取消操作时退出
  7. If userInput = "" Then WScript.Quit

  8. ' 格式化路径为注册表编辑器可识别的格式
  9. regPath = "计算机" & Replace(userInput, "HKEY_", "HKEY_", 1, -1, vbTextCompare)

  10. ' 关闭可能存在的注册表编辑器进程
  11. objShell.Run "taskkill /f /im regedit.exe > nul", 0, True

  12. ' 写入最后访问路径到注册表
  13. On Error Resume Next
  14. objShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey", regPath, "REG_SZ"
  15. If Err.Number <> 0 Then
  16.     MsgBox "路径写入失败,请检查:" & vbCrLf & _
  17.            "1. 输入的路径格式是否正确" & vbCrLf & _
  18.            "2. 是否具有管理员权限", vbCritical, "错误"
  19.     WScript.Quit
  20. End If

  21. ' 启动注册表编辑器
  22. objShell.Run "regedit.exe", 1, False

  23. ' 清理操作(可选)
  24. ' objShell.RegDelete "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey"

  25. MsgBox "已成功跳转到:" & vbCrLf & userInput, vbInformation, "操作完成"
复制代码


保存成VBS即可,注意编码格式ANSI

作者: djsh001    时间: 2025-8-25 19:24
谢谢你!我来试一试。
作者: 印第安老斑鸠    时间: 2025-8-25 19:34
感谢楼主
作者: 燕飞龙    时间: 2025-8-25 19:36
感谢分享
作者: 小灰兔    时间: 2025-8-25 19:37
感谢分享
作者: 蘭蘭    时间: 2025-8-25 19:53
谢谢分享!
作者: yyz2191958    时间: 2025-8-25 19:53
PE 下 用不了
作者: 肉仔    时间: 2025-8-25 20:03
这个干什么用的啊
作者: 倒垃圾的歌者    时间: 2025-8-25 20:18
肉仔 发表于 2025-8-25 20:03
这个干什么用的啊

快捷打开注册表功能,比如输入HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey,可以快速打开注册表HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey这个位置。对于Win7比较实用,Win10只省了一个打开注册表的步骤
作者: 本万    时间: 2025-8-25 20:19
感谢分享
作者: wjgyz740526    时间: 2025-8-25 21:18
建议改成右键菜单,更方便一点
作者: wn168cn@163.com    时间: 2025-8-25 21:46
感谢楼主分享 !!
作者: jjhtya    时间: 2025-8-25 22:10
谢谢分享
作者: in9    时间: 2025-8-26 00:45
谢谢楼主分享!
作者: wang1126    时间: 2025-8-26 07:02
谢谢楼主分享
作者: 201012121135    时间: 2025-8-26 07:11
感谢分享
作者: dksoft    时间: 2025-8-26 08:27
感谢分享
作者: Aronnax    时间: 2025-8-26 09:32
感谢楼主分享,试了一下非常好用
作者: 奈绪    时间: 2025-8-26 11:04
非常实用的工具,感谢楼主分享。
作者: 红五星云少    时间: 2025-8-26 11:10
感谢分享,试试比专门的注册表跳转软件看哪个更方便使用。
作者: lhc12399    时间: 2025-8-26 11:15
谢谢你!
作者: mdhdehao    时间: 2025-8-26 11:18
谢谢分享
作者: tt911    时间: 2025-8-26 11:24
这20年前就玩过了,没啥意思。
随便找几个注册表可以加收藏夹和分类的功能软件就解决了。
作者: guong    时间: 2025-8-26 13:03
感谢分享 !
作者: fegr    时间: 2025-8-26 13:36
谢谢分享
作者: 木子lzq    时间: 2025-8-26 13:38
感谢分享
作者: chibuzhu    时间: 2025-8-26 13:54
感谢分享
作者: yzydys    时间: 2025-8-26 16:21
谢谢楼主分享
作者: kzx1314    时间: 2025-8-26 16:31

感谢分享
作者: nyren    时间: 2025-8-26 16:46
感谢楼主的好物分享!
作者: handsome_xiang    时间: 2025-8-26 16:55
感谢分享!
作者: yaojil    时间: 2025-8-28 06:54
感谢楼主分享 !!
作者: 2011matrixvexx    时间: 2025-8-29 00:41
#在这里快速回复#感谢楼主分享
作者: baby1277    时间: 2025-9-1 11:18
以下是我在用的,集成到右键菜单很方便,不推荐用VBS,因为cmd的文本处理功能更强大。
读取剪贴板内容用PS有点慢,胜在是系统自带的,用第三方命令工具winclip 会快很多,也会支持PE。


  1. :: 定位剪贴板中的注册表路径
  2. for /f "delims=" %%a in ('powershell -noprofile -command "Add-Type -AssemblyName System.Windows.Forms; [System.Windows.Forms.Clipboard]::GetText()"') do set "regpath=%%a"
  3. set regpath=%regpath:[=%
  4. set regpath=%regpath:]=%
  5. set regpath=%regpath:"=%
  6. set regpath=%regpath:计算机\=%
  7. :space
  8. if "%regpath:~-1,1%"==" " (
  9. set regpath=%regpath:~0,-1%
  10. goto space
  11. )
  12. reg query "%regpath%"
  13. if %ERRORLEVEL% neq 0 goto error
  14. reg add "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit" /v "LastKey" /t REG_SZ /d "%regpath%" /f
  15. taskkill /f /im regedit.exe
  16. start regedit.exe
  17. exit
  18. :error
  19. msg %username% /time:5 经过查询,注册表项不存在,请仔细检查。
复制代码

作者: makoto23    时间: 2025-9-1 15:46
谢谢分享
作者: CDP    时间: 2025-9-1 16:00

作者: yuaijueyuan    时间: 2025-9-1 18:20
baby1277 发表于 2025-9-1 11:18
以下是我在用的,集成到右键菜单很方便,不推荐用VBS,因为cmd的文本处理功能更强大。
读取剪贴板内容用PS ...

感谢大佬,用ai改了下,后台静默运行,没有剪切板也不提示,直接退出
作者: realskim    时间: 2025-9-2 11:50
感谢楼主




欢迎光临 无忧启动论坛 (http://bbs.wuyou.net/) Powered by Discuz! X3.3