#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Location
    India
    Posts
    90
    Rep Power
    1

    How to use a registry key to start a program at startup?


    Hey guys!

    I'm working on a program but I wan't the program to start when the Windows starts. I don't want to use the startup folder because its not a very safe location(and it can also become easily infected by a virus). I want use a registry key to start my program. I know that I can use this key:

    Code:
    [HKEY_LOCAL_MACHINE\SOFTWARE\MICROSOFT\WINDOWS\CURRENTVERSION\RUN]
    But I wan't my own registry key. So, If you know a location where I can place my key or a procedure for it then please reply.

    Thanks!
  2. #2
  3. No Profile Picture
    Grumpier old Moderator
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2003
    Posts
    14,439
    Rep Power
    4539
    Try under HKEY_CURRENT_USER\
    ======
    Doug G
    ======
    Bartender to Rene Descartes "have another beer?" Descartes: "I think not" and he vanished.
    --Alfred Bester
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2014
    Location
    India
    Posts
    90
    Rep Power
    1
    I've found one after finding the root of a virus program, its name was 'watermark.exe'. It planted itself in the registry and attached to many applications (explorer, java, chrome, etc) and created copies of it (explorermgr, javamgr). I was able to figure out the place in the registry (though I've to format my computer because it destroyed my explorer) that made it start every time the windows start. It was this:
    Code:
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon]
    In the userinit, it listed itself as a starting program (c:\windows\system32\userinit.exe; c:\program files\microsoft\watermark.exe). I think I can use any registry location, provided its safe, as soon as I figure out how to program my application to do that.

    Thanks for taking your time to answer.

IMN logo majestic logo threadwatch logo seochat tools logo