neyton 发表于 2015-11-7 16:46:00

注册表中的记录以及内容启动套件中的记录,但不执行。
Imports Microsoft.Win32
Public Class Form
    Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
      Dim K_ACADUSER As RegistryKey = Registry.CurrentUser.OpenSubKey("Software\\Autodesk\\AutoCAD")
      Dim VERKEYS As String() = K_ACADUSER.GetSubKeyNames()
      For Each VERKEY In VERKEYS
            Dim K_VERKEY As RegistryKey = K_ACADUSER.OpenSubKey(VERKEY)
            Dim CURVERS As String() = K_VERKEY.GetSubKeyNames()
            For Each CURVER In CURVERS
                Dim K_PROFILES As RegistryKey = K_ACADUSER.OpenSubKey(VERKEY + "\" + CURVER + "\" + "Profiles")
                Dim PROFILES As String() = K_PROFILES.GetSubKeyNames()
                For Each PROFILE In PROFILES
                  MsgBox(VERKEY + "\" + CURVER + "\" + PROFILE)
                  Dim K_PROFILE As RegistryKey = K_PROFILES.OpenSubKey(PROFILE)
                  Dim K_STARTUP As RegistryKey = K_PROFILE.OpenSubKey("Dialogs\Appload\Startup", RegistryKeyPermissionCheck.ReadWriteSubTree)
                  Dim NUMBER As String = K_STARTUP.GetValue("NumStartup")
                  '...
                  K_STARTUP.SetValue("NumStartup", (CInt(NUMBER) + 1).ToString)
                  K_STARTUP.SetValue((CInt(NUMBER) + 1).ToString + "Startup", "C:\TESTE.LSP")
                  '...
                  K_STARTUP.Close()
                  K_PROFILE.Close()
                Next PROFILE
                K_PROFILES.Close()
            Next CURVER
            K_VERKEY.Close()
      Next VERKEY
      K_ACADUSER.Close()
      Me.Close()
    End Sub
End Class

TESTE.LSP
(ALERT "HELLO!")
页: 1 [2]
查看完整版本: 在启动套件中插入程序文件。