An autorun registry key

I want to make a program that shutdowns the computer. This is my code.
#include<direct.h>
#include<fstream>
#include<iostream>
using namespace std;
int main()
{
mkdir("c:/hacked");
ofstream write("c:/hacked/hacked.bat");
write<<"c:/windows/system32/shutdown -s -f -t 00";
write.close();
system("c:/hacked/hacked.bat");
system("PAUSE");

}

My first question is if there is a command that will shutdown windows without making and opening a batch file. The second question is how to make the program autorun without knowing the location of the file. My idea is to send the program to a friend and make him a joke :D. I'll make the program to require a password and if it's not correct, the computer will shutdown :)
Last edited on
Why oh why are do doing this? Please don't, it doesn't look like a joke to me.
Topic archived. No new replies allowed.