Windows: how to boot my program on startup?

1

I've made my app called myapp.exe. I've also added a registry key in:

  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  • HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce
  • HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\Run
  • HKCU\SOFTWARE\Microsoft\Windows\CurrentVersion\RunOnce

The command used in command prompt is: reg ADD HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v MyApp /t REG_SZ /d "%WINDIR%\myApp.exe" /f

I've added it one at a time. myApp doesn't start when my system starts. I'm administrator and checked with msconfig, the keys are properly set. What's wrong? Thank you!

UPDATE 1: As my exe is a wrapper of an executable jar file (created with jsmooth), is it possible that it cannot start with windows due to the fact that it tries to open before jqs.exe (java quick start)? It sounds strange to me but maybe that's the problem!

Angelo

Posted 2013-04-26T19:52:07.450

Reputation: 111

What version of Windows? – None – 2013-04-26T19:54:47.883

Windows XP SP3! myApp path, as you can see, is C:\WINDOWS – None – 2013-04-26T19:58:57.043

Answers

2

Try this, I know it will work with more recent version of Windows (maybe XP):

Don't mess with registry keys at the moment. Just add your .exe (or a shortcut to it) in:

C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

Then go into msconfig.exe, startup tab and see if it gets populated in the startup list (if so, obviously check it and reboot your computer)

EDIT:

If you want to use the registry method like you posted instead of adding it to the startup menu:

  • Create an entry in the registry under HKLM\Software\Microsoft\Windows\CurrentVersion\Run (you did this already)
  • Navigate to HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run
  • Create a new string value and give it a useful name for reference.
  • Set the value to the full path (and params) of the EXE you want to run.

This should work. And if it doesn't, then yes, you will need to make sure whatever dependencies your exe uses are running before hand. If you were to run your .exe now with jqs.exe off and it doesn't work, you'll know that it needs to be run when Windows starts up as well.

ryrich

Posted 2013-04-26T19:52:07.450

Reputation:

I'm going to try but I don't want to use that method, because the app is seen into the startup folder. – None – 2013-04-26T20:04:07.720

I can see it in msconfig, but it doesn't work, see updated answer! – None – 2013-04-26T20:11:46.800

@Angelo see my post edit for more information. – None – 2013-04-26T20:18:01.013

That doesn't work even with jqs off. I cannot find a solution! Thanks for your help anyway! – None – 2013-04-26T20:44:48.767