Results 1 to 6 of 6

Thread: Run on Startup?

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Posts
    207

    Run on Startup?

    How would I make my application run on startup?

  2. #2
    Hyperactive Member danecook21's Avatar
    Join Date
    Feb 2008
    Location
    NC, USA
    Posts
    501

    Re: Run on Startup?

    I would suggest making a setup program (I use Inno Setup) and in the process you can add an option for your user to choose it to load at startup.

  3. #3
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Run on Startup?

    Brother,
    You can do it by adding some New Registry Values. But I don't know how to do that. But one thing that can be done is, write some code in the main form's load event for making a shortcut link of your program, on the Startup folder of "All Users" (taking the case of CP machine only). And you can include some code for checking whether the link is existing or not. If not, then the code for creating link. Such that.. But its not a better solution, because the user needs to run your application for atleast once to work out this...
    I think you better use some scripts of Inno Setup or any other install programs like danecook21 said...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  4. #4
    VB For Fun Edgemeal's Avatar
    Join Date
    Sep 2006
    Location
    WindowFromPoint
    Posts
    4,255

    Re: Run on Startup?

    You can use this StartWithWindows.bas module. In your program you would add a check box named "Start_Up" so the the user could easily enable or disable the program to start with windows.

    Code:
    Private Sub Form_Load()
        ' SET THE CHECK BOX TO SHOW THE START WITH WINDOWS STATE.
        If WillRunAtStartup(App.EXEName) = True Then
            Start_Up.Value = 1
        Else
            Start_Up.Value = 0
        End If    
    End Sub
    
    Private Sub Start_Up_Click()   
        ' SET START WITH WINDOWS ON/OFF
        Dim RunOnWinStart As Boolean
    
        If Start_Up.Value = 1 Then
            RunOnWinStart = True
        Else
            RunOnWinStart = False
        End If
    
        SetRunAtStartup App.EXEName, App.Path, RunOnWinStart    
    End Sub
    btw I didn't write the module, forget where I got it.
    Attached Files Attached Files

  5. #5
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: Run on Startup?

    Quote Originally Posted by Blackbelt12
    How would I make my application run on startup?
    This should not be a default setting of your application. This should be an option that can be used, or not used, by the application users.

  6. #6

    Thread Starter
    Addicted Member
    Join Date
    Feb 2008
    Posts
    207

    Re: Run on Startup?

    No I'm sorry, its not the default setting application. It is supposed to be a setting. I just couldn't figure out how to do it.

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