Thread: Adding program to startup

  1. #1
    Registered User
    Join Date
    Oct 2007
    Posts
    5

    Adding program to startup

    I want to know how to code a program that will add itself to startup once it has installed on a machine. I am trying to make a scary program that will run every time my friend starts up his computer but i dont know what the right code is to make it do it. Can some one please help me and give me an example code on how this will work for visual studios 2005. And i want the program to add itself to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Run\

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Find yourself some recent registry code somewhere out there; that will be the easiest way. Otherwise you'll have to work with the win32 api.
    I'm sure someone can help you code that, but it will be much easier if you actually used a registry solution that exists somewhere, like CodeProject.

  3. #3
    and the hat of sweating
    Join Date
    Aug 2007
    Location
    Toronto, ON
    Posts
    3,545

  4. #4
    Registered User
    Join Date
    Oct 2007
    Posts
    5
    thanks i think i have it now

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,656
    You might want to consider whether such things as computer mis-use are illegal in your jurisdiction, whether your skills are sufficient to write a program which won't hose your friends entire machine (by accident), or whether your friend (perhaps soon to be ex-friend) won't be provoked into an expensive course of action to repair the "damage".
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Issue with program that's calling a function and has a loop
    By tigerfansince84 in forum C++ Programming
    Replies: 9
    Last Post: 11-12-2008, 01:38 PM
  2. Using variables in system()
    By Afro in forum C Programming
    Replies: 8
    Last Post: 07-03-2007, 12:27 PM
  3. Make a program run at startup
    By cookie in forum Tech Board
    Replies: 2
    Last Post: 06-08-2007, 08:36 PM
  4. Replies: 2
    Last Post: 05-10-2002, 04:16 PM
  5. My program, anyhelp
    By @licomb in forum C Programming
    Replies: 14
    Last Post: 08-14-2001, 10:04 PM