hi, im making a program and i need it to start when the computer sarts
could someone give me some guidance
thanks for reading (and hopefuly answering)

Recommended Answers

All 7 Replies

there are many ways :
1. put the exe file on startup folder (manually)
2. Get the Startup folder and copied your exe file to startup folder.
3. Use registry to run your program when windows start.

To bad that Pocket PC or Smartphone don't have this option. It will really help me with something I am working on.

Dim startup As String = Environment.GetFolderPath(Environment.SpecialFolder.Startup)
IO.File.Copy(Application.ExecutablePath, startup & "\Poise.exe")

seen this many times before with your problem

Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
    My.Computer.Registry.LocalMachine.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValueApplication.ProductName, Application.ExecutablePath)
    End Sub

Can any one give any example for this program?

You can move a copy of ur .exe in code to d startup folder of the current user if not there with this code- My.Computer.FileSystem.MoveFile(current .exe path,new .exe path-["C:\Documents And Settings\" & Environment.User & "\Startup\program.exe"]. This works on windows xp cos this is the path to the startup folder as arranged by the OS.

i think the most simple way is this that when you make setup of your application to deploy it on your client machine , the window where you add all your files present in bin folder , and create shortcut at the desktop , there are two columns , you just right click on the left column , and a pop up window will open , just select startup folder and click it , then startup folder option will add into your left column , now select it and right click on the right column and select add shortcut and select the exe file same as you done before in desktop folder case , THAT's IT
now just simple install your application in any computer , your application will automaticaly add a shortcut to your startup folder , and will run when ever computer is starts .

Sorry for my bad english ,

Best Regards

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.