CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Sep 2009
    Posts
    2

    Registry vs Startup menu

    Hi,

    I want to run my application right after user login. When I put a shortcut to my application at the startup menu (Start>All Programs>Startup) the app ran perfectly. When I put it in the registry,
    (I've tried both HKCU and HKLM - Software\Microsoft\Windows\CurrentVersion\Run), the app crashes.
    Any ideas how to continue from here? What is the difference between the two?

    Thanks,
    aperfectpoint

  2. #2
    Join Date
    Apr 2005
    Posts
    107

    Re: Registry vs Startup menu

    It shouldn't matter unless you have some weird dependancy, "Run" key registry entries "In General" start before the Startup Programs folder is processed, but that can by changed or bypassed.

    There are really about 10 places that programs can be automatically started, but you really don't need to know them, and should never use them unless you know exactly why you are (in which case, you know the keys).

    Personally, I block 100% of everything that tries to put 'Startup' programs in the registry. Put them in the folder, or don't bother.

    Oh, None of the registry "Run" keys (of any user flavor) will be read at all in safe mode, I'm not certain about the startup folder.

    If your program crashes from one, and not the other, simply put, you have a bug, or are trying to initialize something before a dependency is met, and you aren't handling it properly.

  3. #3
    Join Date
    Oct 2009
    Posts
    2

    Re: Registry vs Startup menu

    Hi, rdrast

    I'm new to this forum... sorry for barging in here, but I cannot seem to figure out how to start a thread on this forum! Can you please give me a clue!

    Best regards and please forgive the intrusion APerfectPoint...

    DKean

  4. #4
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Registry vs Startup menu

    I've seen an XP machine (today) that was so infected that task manager was disabled in SAFE MODE. There was also a program RUNNING in the task bar that couldn't be stopped. Did a slow format, and it's doing fine now.
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

  5. #5
    Join Date
    Sep 2009
    Posts
    2

    Re: Registry vs Startup menu

    Thanx rdrast.
    You are saying that I might mishandle the dependency, which must be the problem, since I don't have any bugs... (Kiddin' of course, but in this case I think it is more likely). How do I manage the dependency, from both within the code and within the registry? I noticed that when I run it from the Startup folder, the Pid it gets is rather high, and when I (try to) run it from the registry, it gets a pretty low pid. Is this related? How can I heighten (is this the correct term?) the pid?

    Thanks

  6. #6
    Join Date
    Apr 2005
    Posts
    107

    Re: Registry vs Startup menu

    I don't know your program. It could be any dependency, that is not properly trapped.
    For example, under Windows XP, the network might not actually be started until long after the user is logged in, and the desktop is up. There are ways to control this, and force the network to be initialized even before the Login prompt, but that is often disabled to speed up the boot process.

    What if your program is relying on network services, and they are not available? Do you wait? Do you crash? Do you abort? That is all in your program. All dependencies are.

    And why do you even care what the PID is? It doesn't matter in the slightest.

  7. #7
    Join Date
    Jul 2001
    Location
    Sunny South Africa
    Posts
    11,284

    Re: Registry vs Startup menu

    More importantly, what OS are you using ¿

  8. #8
    Join Date
    Jan 2006
    Location
    Fox Lake, IL
    Posts
    15,007

    Re: Registry vs Startup menu

    PID's are assigned based on what level the process is running UNDER. User, System, etc
    David

    CodeGuru Article: Bound Controls are Evil-VB6
    2013 Samples: MS CODE Samples

    CodeGuru Reviewer
    2006 Dell CSP
    2006, 2007 & 2008 MVP Visual Basic
    If your question has been answered satisfactorily, and it has been helpful, then, please, Rate this Post!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured