Adding program to startup

This is a discussion on Adding program to startup within the C++ Programming forums, part of the General Programming Boards category; I want to know how to code a program that will add itself to startup once it has installed on ...

  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をこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,604
    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 wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,535
    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.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

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, 12: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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21