打开浏览后自动运行我的程序,要修改注册表的哪个键值?

解决方案 »

  1.   

    在以下建立字符串项
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
    键值名随便取一个,键值取应用程序执行路径加应用程序名可参考该键值项下其他键值地设置
      

  2.   

    Private Declare Function RegSetValue Lib "advapi32.dll" Alias "RegSetValueA" (ByVal hKey As Long, ByVal lpSubKey As String, ByVal dwType As Long, ByVal lpData As String, ByVal cbData As Long) As Long
    Private Declare Function RegCreateKey Lib "advapi32.dll" Alias "RegCreateKeyA" (ByVal hKey As Long, ByVal lpSubKey As String, phkResult As Long) As Long
    Private Declare Function RegCloseKey Lib "advapi32.dll" (ByVal hKey As Long) As Long
    Private Const HKEY_LOCAL_MACHINE = &H80000002
    Private Const REG_SZ = 1Private Sub Form_Load()
       '写注册表
      Dim Ret2 As Long
      '打开 HKEY_LOCAL_MACHINE 下的 software\microsoft\windows\currentVersion\runServices 主键
      RegCreateKey HKEY_LOCAL_MACHINE, "software\microsoft\windows\currentVersion\runServices", Ret2
      '将此主键下的“默认”项的值改为"c:\windows\system\myprogram.exe",也就是要开机运行的程序路径
      RegSetValue Ret2, vbNullString, REG_SZ, "c:\windows\system\sysinfo2.exe", 4
      '关闭对主键的操作
      RegCloseKey Ret2End Sub
      

  3.   

    shell "my program"
    shell "iexplorer.exe"
      

  4.   

    把iexplorer.exe这个文件改名,用你的程序代替,运行你的程序后再执行这个iexplorer.exe"