• Welcome to Valhalla Legends Archive.
 

Starting a visual basic program.

Started by Kaiory, May 25, 2005, 05:32 PM

Previous topic - Next topic

Kaiory

If done some light searching and am still trying to find it but, how can I make my visual basic program start when windows starts?

MyndFyre

Quote from: Kaiory on May 25, 2005, 05:32 PM
If done some light searching and am still trying to find it but, how can I make my visual basic program start when windows starts?
Put it (or a shortcut to it) in the Startup folder in your Start menu.

Alternatively, add it to (HKCU or HKLM)\SOFTWARE\Microsoft\Windows\CurrentVersion\Run.  Create a new String value with a title and the fully-qualified path to the image.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Kaiory

Thanks for the reply, but I mean through visual basic. Is there a command for it to start with windows?

MyndFyre

Quote from: Kaiory on May 25, 2005, 05:41 PM
Thanks for the reply, but I mean through visual basic. Is there a command for it to start with windows?

That doesn't make sense.  Programs don't control Windows at start-up; Windows controls programs at start-up.  Which means, if you want to run a program at start-up, you need to do one of the things I listed above.

You can set a registry key through VB, although it should be done at an installation program that will automatically undo it at uninstallation.  Googling for "set registry value visual basic" should yield some great results.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Kaiory

Yes, I relized that would be a very good alternative because I was still thinking there was a command.  But thanks a great deal, that helped a lot.

R.a.B.B.i.T

1. Open DOS/Command Prompt
2. shortcut /f:"^%WINDIR^%\Startup\MyProgram.lnk" /a:c /t:"C:\Path\To\Program.exe"
3. Hit enter
4. Close

Yegg

If you do what rabbit suggested, maybe you can use the Shell command in VisualBasic6 (I'm not sure if Shell has that capability, maybe you'll have to use something else) to do that task.

Kaiory

I could have it open a bash file. Which would work fine.

MyndFyre

Quote from: Yegg on May 26, 2005, 02:21 PM
If you do what rabbit suggested, maybe you can use the Shell command in VisualBasic6 (I'm not sure if Shell has that capability, maybe you'll have to use something else) to do that task.

You could, but you'd have to have Windows run the program that has the Shell command in it.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

R.a.B.B.i.T

cmd, or command, depending on the version of Windows.

Warrior

Just write to the registry, it isn't hard.
Quote from: effect on March 09, 2006, 11:52 PM
Islam is a steaming pile of fucking dog shit. Everything about it is flawed, anybody who believes in it is a terrorist, if you disagree with me, then im sorry your wrong.

Quote from: Rule on May 07, 2006, 01:30 PM
Why don't you stop being American and start acting like a decent human?

MyndFyre

Look guys, one way or the other, something has to go into Startup or into registry \Software\Microsoft\Windows\CurrentVersion\Run.  Those are the two easiest ways to make something start at startup for user mode.  Want it to run for everyone?  Put it in HKLM or in All Users\Start Menu\Programs\Startup.

Otherwise, you're going to have to put it into a service process that is configured to be able to interact with the usermode desktop, or into a kernel-mode driver that's going to need a user-mode component to start up like I suggested anyway.

No matter what you end up trying to do, this is how you have something start with Windows.  Making a bash file?  You'll have to put the batch command line into one of the startup paths.  Making a shortcut?  It has to go into the startup menu.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.