Windows: how to boot my program on startup?

Posted on

QUESTION :

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

  • HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun
  • HKLMSOFTWAREMicrosoftWindowsCurrentVersionRunOnce
  • HKCUSOFTWAREMicrosoftWindowsCurrentVersionRun
  • HKCUSOFTWAREMicrosoftWindowsCurrentVersionRunOnce

The command used in command prompt is: reg ADD HKLMSOFTWAREMicrosoftWindowsCurrentVersionRun /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!

ANSWER :

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:ProgramDataMicrosoftWindowsStart MenuProgramsStartup

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 HKLMSoftwareMicrosoftWindowsCurrentVersionRun (you did this already)
  • Navigate to HKEY_LOCAL_MACHINESoftwareMicrosoftWindowsCurrentVersionRun
  • 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.

Leave a Reply

Your email address will not be published.