hath hassan
hath hassan

Reputation: 59

Make the program run with the computer startup VB.NET?

I want to make my program run with the computer startup in VB.NET. I know there is a lot of codes about it but why some antivirus is detected these codes as a virus when people use my program, they will think the file is a virus and I will lose my reputation so please help me (any code you have or method please put it in a comment I will test it).

I use this code:

My.Computer.Registry.CurrentUser.OpenSubKey("SOFTWARE\Microsoft\Windows\CurrentVersion\Run", True).SetValue(Application.ProductName, Application.ExecutablePath)

Upvotes: 1

Views: 1512

Answers (1)

Abhi verma
Abhi verma

Reputation: 298

@Steve describes the right way , you will not need to write any code. Just copy the .exe shortcut to the startup folder. This can be done by setup if your program has or by manually or your program can do at first runtime.

Use Environment.SpecialFolder.Startup to get the directory.

Paste shortcut there.

Upvotes: 1

Related Questions