• 注册表位置:

    机器:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    用户:HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run


  • 应用的脚本代码:

读取当前机器启动项(HKEY_LOCAL_MACHINE):

' Created by Sergey Tkachenko
Dim objHTA
Dim cClipBoard
Dim WshShell
set objHTA=createobject("htmlfile")
cClipBoard=objHTA.parentwindow.clipboarddata.getdata("text")
cClipBoard="HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey", cClipBoard, "REG_SZ"
WshShell.Run "regedit.exe -m"
Set objHTA = nothing
Set WshShell = nothing

读取当前用户启动项(HKEY_CURRENT_USER):

' Created by Sergey Tkachenko
Dim objHTA
Dim cClipBoard
Dim WshShell
set objHTA=createobject("htmlfile")
cClipBoard=objHTA.parentwindow.clipboarddata.getdata("text")
cClipBoard="HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.RegWrite "HKCU\Software\Microsoft\Windows\CurrentVersion\Applets\Regedit\LastKey", cClipBoard, "REG_SZ"
WshShell.Run "regedit.exe -m"
Set objHTA = nothing
Set WshShell = nothing
  • Bat导出注册表项目到REG格式文件,使用Regedit:

机器:

@echo off&title %~nx0
REM 注意Win10系统,此脚本必须以管理员权限运行~
regedit /E %~dp0HKLM_Run.reg "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run"
echo  all thing have done...
echo\&pause

用户:

@echo off&title %~nx0
REM 注意Win10系统,此脚本必须以管理员权限运行~
regedit /E %~dp0HKCU_Run.reg "HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Run"
echo  all thing have done...
echo\&pause