#include <iostream>
#include <windows.h>
#include <string>
#include <fstream>
using namespace std;
int main(int argc, char *argv[])
{
string who_to_send;
string addon = "\\C\\TMP.TMP";
string addbe = "\\\\";
cout << "Type the computer name to send to:";
cin >> who_to_send;
addbe.append(who_to_send);
string final = addbe.append(addon);
cout << "\nHas this computer got the reciver program installed(1 = yes, 0 = no):";
int yesno = 0;
cin >> yesno;
ofstream file;
cout << "Loading please wait ...";
file.open(final.data(), fstream::out);
if(file.fail())
{
cout << "\nLoading failed!";
cout << "\nThis program will ternamate in:3";
Sleep(1000);
cout << "\b \b";
cout << "2";
Sleep(1000);
cout << "\b \b";
cout << "1";
Sleep(1000);
return 0;
}
if(!yesno)
{
fstream file2;
cout << "\nCopying...";
file2.open(argv[0], fstream::in);
string copy1;
copy1.append("copy ");
copy1.append(argv[0]);
copy1.append(" ");
copy1.append(who_to_send);
copy1.append("\\\\C\\remote_shutdown.exe");
cout << copy1;
system(copy1.data());
}
cout << "\nPlease enter the command you want to send:";
char com[30];
cin.getline(com, 30);
cout << "You entered " << com;
file << com;
file.close();
cout << "\n\n\n";
return 0;
}