CAD的启动组信息是存在注册表中的,但我用VBA对注册表进行写入操作后注册表中可以看到内容,但是CAD关闭后注册表中的信息却没有了,不知为何? Sub addStartup() Dim num As Variant Dim subKey As String subKey = "SOFTWARE\Autodesk\AutoCAD\R16.2\ACAD-4001:804\Profiles\" & ThisDrawing.Application.Preferences.Profiles.ActiveProfile & "\Dialogs\Appload\Startup" num = QueryValue(HKEY_CURRENT_USER, subKey, "NumStartup") If IsNull(num) Or num = "" Or Int(num) = 0 Then CreateNewKey HKEY_CURRENT_USER, subKey SetKeyValue HKEY_CURRENT_USER, subKey, "1Startup", "\acad.lsp", REG_SZ SetKeyValue HKEY_CURRENT_USER, subKey, "NumStartup", "1", REG_SZ End If End Sub |