473,395 Members | 1,502 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Getting your C++ *.exe program to copy it self to start up

Hey whats the code to get a C++ program to copy its self to.

So far ive done some looking into this topic and i have to some how get it in these parts.

All users: HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\Curr entVersion\Run

Current user only: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\Curre ntVersion\Run

SO what code do i need to enter for my program to copy its self into these registerys.

Or if i want to copy it to

C:\Documents and Settings\UserName\Start Menu\Programs\Startup

Can anyone help? I cant seem to find the right code.

Any help would be Great!!
Feb 12 '07 #1
6 4451
If you placed the exe file in the startup folder then that particular exe file will run when ever you restart system logged in under that particular user.....
Feb 12 '07 #2
If you placed the exe file in the startup folder then that particular exe file will run when ever you restart system logged in under that particular user.....
Lol i know that.

But i need the code so when ym exe is ran bye a person this code wille execute and it will copy it self to that location.
Feb 12 '07 #3
Any help anyone?
Feb 13 '07 #4
sicarie
4,677 Expert Mod 4TB
Any help anyone?
Have you looked at the MSDN site?
Feb 13 '07 #5
Nope wont work i tryed it but it wont work.

Hmm it didnt reconise

RegistryKey^ rk; and

using namespace System;
using namespace Microsoft::Win32;

I dunno what to do can you help me?
Feb 13 '07 #6
Not sure or anything but i aint using Visual C++ im useing the old one im think

This might help

#include <iostream>

useing namespace std:

im using that one

PS I tryed Editing would'nt let me
Feb 13 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Jane Austine | last post by:
As you add more items, say text lines, in Text widget, it gets too slow and almost impractical to use on. Take idle for example. If the text gets bigger(e.g. print...
4
by: Erik Lechak | last post by:
Hello all, Is there anyone out there that has written anything in python to download tv listings (no XML)? All the tv listing stuff that I can find is way too complex for my taste (includes...
303
by: mike420 | last post by:
In the context of LATEX, some Pythonista asked what the big successes of Lisp were. I think there were at least three *big* successes. a. orbitz.com web site uses Lisp for algorithms, etc. b....
1
by: Dan Stromberg | last post by:
The below small program is giving strange behavior. At the bottom of the code, please find "this works" and "this doesn't work" comments. Why does one work and the other not? TIA. ...
9
by: Brian Roberts | last post by:
I have a command line Python program that sometimes takes a bit (several minutes) to run. I want to provide an optional method for an impatient user (me!) to check the status of the program. The...
1
by: Iyer, Prasad C | last post by:
Hi, I am trying to create a small utility program which would be configured in registry. Something like this Windows Registry Editor Version 5.00 @="\"python...
10
by: jon | last post by:
I am a beginner C programmer, this is actually my first programming lanugage, besides html, cgi, and javascript. I am looking for a way to make an .exe file, or a copy of my own file. I have tried...
0
by: ashishbathini | last post by:
Hi guys here is my problem ... this is the source code I Have , honestly I hav no idea how it works bcos its too complicated for me .... but my problem is ... i hav a freq comonent in it .......
3
by: paulus4605 | last post by:
dears since I'm new to ruby I try to create a form within ruby on rails. this is my controller require "player" class SpelersController < ApplicationController def index @speler =...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.