VB怎样加到开机自动启动
发布网友
发布时间:2024-10-18 13:30
我来回答
共4个回答
热心网友
时间:2024-12-01 02:38
不用操作注册表 直接在启动栏里添加快捷方式不就可以了么?
调用vb6stkit.dll
窗体代码:
Private Declare Function fCreateShellLink Lib "vb6stkit.dll" (ByVal lpstrFolderName As String, ByVal lpstrLinkName As String, ByVal lpstrLinkPath As String, ByVal lpstrlinkarguments As String, ByVal fprivate As Long, ByVal sparent As String) As Long
Private Sub Form_Load()
fCreateShellLink "..\程序\启动", "工程1", App.Path & "\工程1", "", ture, "$(Programs)"
End Sub
热心网友
时间:2024-12-01 02:32
你把VB的图标复制到:开始——所有程序——启动;里就行了啊!
热心网友
时间:2024-12-01 02:33
Dim w As Object
Set w = CreateObject("wscript.shell")
w.regwrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" & "要显示的名称", App.path & "\" & App.EXEName & ".exe"
这个是将自身改成开机自启动,.exe文件类型的。
热心网友
时间:2024-12-01 02:31
开机自动运行:
Set w = CreateObject("wscript.shell")
w.regwrite "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" & App.EXEName, App.Path & "\" & App.EXEName & ".exe"
取消自动运行:
Set w = CreateObject"wscript.shell"
w.regdelete "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run\" & App.EXEName
把程序复制到启动项里:
FileCopy App.Path + IIf(Len(App.Path) > 3, "\", "") + "" & App.EXEName & ".exe", "C:\Documents and Settings\Administrator\「开始」菜单\程序\启动\" & App.EXEName & ".exe"
最后一个要生成后才能正常用