0

I want to add my application to autostart. I am adding a value to: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Run

With a path to my exe. The code is 100% correct, but somehow, when I ran it, it wasn't working. I was pulling my hair out because of that, I tried everything. But later, when I restarted my PC, the application ran on startup! How is that possible? I don't see my value in the registry. Can someone help me? Thanks in advance.

Piotr Joniec
  • 157
  • 1
  • 2
  • 13
  • Can you post the code? – Charlie Gorichanaz Apr 12 '13 at 06:46
  • 1
    These two statements "The code is 100% correct" and "but somehow, when I ran it, it wasn't working." are contra-positive in their very nature. Don't describe the code; *Post it*. That said, if your application is a 32bit process running on 64bit windows, chances are you're not modifying the registry key you think you are. Check the `Wow6432Node` sub registry under HKEY_LOCAL_MACHINE if your process is 32bit. I think you may find what you're looking for. – WhozCraig Apr 12 '13 at 06:53
  • If the application is 32-bit and the OS is 64-bit see: http://stackoverflow.com/questions/14585286/c-regcreatekeyex-success-but-without-result/14585359#14585359 – hmjd Apr 12 '13 at 06:54
  • 2
    My guess: You are running a 32-bit program on a 64-bit machine. Your entries are redirected to HKEY_LOCAL_MACHINE\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Run – adrianm Apr 12 '13 at 06:55

1 Answers1

1

If your application is 32 bit and OS you are checking is 64 bit.The registry will be updated in HKEY_LOCAL_MACHINE\Software\Wow6432Node.....

shivakumar
  • 3,297
  • 19
  • 28