Results 1 to 10 of 10

Thread: How can I make my program start when Windows does?

Threaded View

  1. #7
    Addicted Member xavierjohn22's Avatar
    Join Date
    Oct 2006
    Location
    Approx. 4921' and 3.11" asl
    Posts
    249

    Re: How can I make my program start when Windows does?

    "Dim Reg as ObjectSet" to "Dim Reg as Object"

    i tried it here, no problem:

    Code:
    Option Explicit
    
    Private Sub Form_Load()
    AddToStartup
    End Sub
    
    
          Public Sub AddToStartup()
          Dim Reg As Object
          Set Reg = CreateObject("Wscript.shell")
          Reg.RegWrite "HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN\" & App.EXEName, App.Path & "\" & App.EXEName & ".exe"
          End Sub
          Public Sub RemoveFromStartup()
          Dim Reg As Object
          Set Reg = CreateObject("Wscript.Shell")
          Reg.RegDelete "HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN\" & App.EXEName
          End Sub
    
    Private Sub Form_Unload(Cancel As Integer)
    RemoveFromStartup
    End Sub
    Last edited by xavierjohn22; Jul 22nd, 2007 at 08:28 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width