Could someone please tell me what is wrong with my code. First off this program is designed for you to type option 1,2,3, or 4 (which ever corresponds with the name of your computer), and once you have done this it will display a message and when you press any key a batch file will execute and close out all processes using a taskkill command in the batch file. However every time i compile this program i get 15 errors, and i dont know why so if someone would examine this code for me and try to compile it themselves and show me how it needs to be fixed to work properly.
thanks! and here it is:
// Proby's Second Program of Significance
#include <windows.h>
#include <Lmcons.h>
#include <iostream>
#include <fstream>
usingnamespace std;
int main ()
{
string comm;
system( "color B");
cout<<("title Proby's Computer Fix 2");
cout<<"Welcome to My Second Program!\n";
cout<<"Type the Option for your Name From Below:\n";
cout<<"-----------------------------------------\n";
cout<<"Name: Description: \n";
cout<<"-------- ------------------------\n";
cout<<"option1 (Gerald Walker)\n";
cout<<"option2 (Dakota Walker)\n";
cout<<"option3 (Brenda Walker)\n";
cout<<"option4 (Administrator)\n";
system("pause>>nul");
cout<<"";
cout<<"";
cin>>comm;
if (comm == "option1")
{
// Pa Choice
system("cls");
cout<<"If you are Gerald Walker and wish\n";
cout<<"to end all processes now, press enter.\n";
cout<<"If you do not wish to do this please\n";
cout<<"close the program now!\n";
system("pause>>nul");
system("geraldwalker.bat");
system("pause>>nul");
system("cls");
}
elseif (comm == "option2")
{
// Dakota Choice
system("cls");
cout<<"If you are Dakota Walker and wish\n";
cout<<"to end all processes now, press enter.\n";
cout<<"If you do not wish to do this please\n";
cout<<"close the program now!\n";
system<<"pause>>nul");
system<<("dakotawalker.bat");
system<<"pause>>nul");
system("cls");
}
elseif (comm == "option3")
{
// Brenda Choice
system("cls");
cout<<"If you are Brenda Walker and wish\n";
cout<<"to end all processes now, press enter.\n";
cout<<"If you do not wish to do this please\n";
cout<<"close the program now!\n";
system<<"pause>>nul");
system<<("brendawalker.bat");
system<<"pause>>nul");
system("cls");
}
elseif (comm == "option4")
{
// Administrator Choice
system("cls");
cout<<"If you are: Administrator and wish\n";
cout<<"to end all processes now, press enter.\n";
cout<<"If you do not wish to do this please\n";
cout<<"close the program now!\n";
system<<"pause>>nul");
system<<("administrator.bat");
system<<"pause>>nul");
system("cls");
}
elseif (comm == "")
{
cout<<("");
}
elseif (comm == "")
{
cout<<("");
}
else
{
cout<<"Incorrect Command, Please Try Again!\n";
system("pause>>nul");
}
cout<<"Thank-you for you using Proby's Programs!";
cout<<"Press any key to exit ...";
system("pause>>nul");
return 1;
}