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
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.