Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Matthew K
- //Windows Controls
- //Final Project
- #include <iostream.h>
- #include "katzenm.h"
- //katzenm.h is the same as utility.h but with my ColorChange function.
- //Random.h and String.h included in katzenm.h.
- //*******************************************************************************************************************
- int main()
- {
- system("Title Matthew's Crazy Windows Commands Program");
- int Num, RussianNum,Xnum=0,stime,rtime;
- randomize();
- String color, AbortPW="mirror",PWEntered;
- while (Num!=11)
- {
- system("cls");
- cout<<" 0: Russian Roulette"<<endl;//Play at your own risk.
- cout<<" 1: Command Prompt"<<endl;
- cout<<" 2: Control Pannel"<<endl;
- cout<<" 3: Notepad"<<endl;
- cout<<" 4: Change Color"<<endl;
- cout<<" 5: View Time"<<endl;
- cout<<" 6: Change Time"<<endl;
- cout<<" 7: Shutdown"<<endl;
- cout<<" 8: Logoff"<<endl;
- cout<<" 9: Restart"<<endl;
- cout<<"10: Abort"<<endl;
- cout<<"11: End Program"<<endl;
- cout<<"Enter Your Choice: ";
- cin>>Num;
- cout<<endl;
- switch(Num)
- {
- case 0:
- cout<<"You had to hit 0."<<endl<<"Now you will pay the price."<<endl;
- RussianNum=random(6);
- if (RussianNum==0)
- {
- system("shutdown -s");
- cout<<endl<<"Bye-Bye"<<endl;
- Pause();
- }
- else if (RussianNum==1)
- {
- system("shutdown -r");
- cout<<endl<<"Fatal Error: Your computer is melting."<<endl;
- Pause();
- }
- else if (RussianNum==2)
- {
- system("shutdown -l");
- cout<<endl<<"You are being log-ed off!?!?!??!?!"<<endl;
- Pause();
- }
- else if (RussianNum==3)
- {
- for (int i=1;i<=100;i++)
- {
- cout<<endl<<"Arn't Colors Fun!!!!!!!"<<endl;
- //ColorChange is in katzenm.h but i still wrote it.
- ColorChange("27");
- ColorChange("F4");
- ColorChange("6B");
- ColorChange("A2");
- ColorChange("95");
- ColorChange("64");
- ColorChange("12");
- ColorChange("98");
- ColorChange("56");
- ColorChange("94");
- ColorChange("FB");
- ColorChange("C2");
- ColorChange("0F");
- ColorChange("F0");
- ColorChange("FA");
- ColorChange("72");
- ColorChange("4F");
- ColorChange("B6");
- ColorChange("2A");
- ColorChange("59");
- ColorChange("34");
- ColorChange("64");
- ColorChange("12");
- ColorChange("98");
- ColorChange("56");
- ColorChange("94");
- ColorChange("FB");
- ColorChange("C2");
- ColorChange("0F");
- ColorChange("F0");
- ColorChange("A5");
- ColorChange("2E");
- ColorChange("2A");
- ColorChange("B4");
- ColorChange("6C");
- ColorChange("D2");
- ColorChange("9E");
- ColorChange("FA");
- ColorChange("32");
- ColorChange("4A");
- ColorChange("AF");
- ColorChange("EC");
- ColorChange("90");
- ColorChange("09");
- ColorChange("64");
- ColorChange("12");
- ColorChange("98");
- ColorChange("56");
- ColorChange("94");
- ColorChange("FB");
- ColorChange("C2");
- ColorChange("0F");
- ColorChange("F0");
- ColorChange("01");
- ColorChange("02");
- ColorChange("25");
- ColorChange("67");
- ColorChange("94");
- ColorChange("12");
- ColorChange("AF");
- ColorChange("FA");
- ColorChange("AF");
- ColorChange("FA");
- ColorChange("A2");
- }
- }
- else if (RussianNum==4)
- {
- system("shutdown -s -t 86400");
- cout<<endl<<"The suspense is killing you."<<endl;
- Pause();
- }
- else
- {
- cout<<endl<<"You win, this time!!!"<<endl;
- Pause();
- }
- }
- if (Num==0)
- {
- }
- else if (Num==1)
- {
- cout<<endl<<"Type 'exit' to return to program."<<endl<<"Type 'help' for a list of commands."<<endl;
- Pause();
- cout<<endl;
- system("command");
- }
- else if (Num==2)
- system("control");
- else if (Num==3)
- system("notepad");
- else if (Num==4)
- {
- cout<<endl;
- cout<<"0: Black"<<endl;
- cout<<"1: Blue"<<endl;
- cout<<"2: Green"<<endl;
- cout<<"3: Aqua"<<endl;
- cout<<"4: Red"<<endl;
- cout<<"5: Purple"<<endl;
- cout<<"6: Yellow"<<endl;
- cout<<"7: White"<<endl;
- cout<<"8: Gray"<<endl;
- cout<<"9: Light Blue"<<endl;
- cout<<"A: Light Green"<<endl;
- cout<<"B: Light Aqua"<<endl;
- cout<<"C: Light Red"<<endl;
- cout<<"D: Light Purple"<<endl;
- cout<<"E: Light Yellow"<<endl;
- cout<<"F: Bright White"<<endl;
- cout<<"Enter your color in the [Backcolor][Text Color] format."<<endl;
- cout<<"Enter Your Color: ";
- cin>>color;
- ColorChange(color);
- }
- else if (Num==5)
- {
- system("time/t");
- Pause();
- cout<<endl;
- }
- else if (Num==6)
- {
- system("time");
- cout<<endl;
- }
- else if (Num==7)
- {
- while (true)
- {
- system("cls");
- cout<<"Select Shutdown Delay:"<<endl;
- cout<<"\t0: Cancel"<<endl;
- cout<<"\t1: No Delay"<<endl;
- cout<<"\t2: 5 Second Delay"<<endl;
- cout<<"\t3: 30 Second Delay"<<endl;
- cout<<"\t4: 1 Minute Delay"<<endl;
- cout<<"\t5: 5 Minute Delay"<<endl;
- cout<<"\t6: 30 Minute Delay"<<endl;
- cout<<"\t7: 1 Hour Delay"<<endl;
- cout<<"\t8: 1 Day Delay"<<endl;
- cout<<"Enter Your Choice: ";
- cin>>stime;
- if (stime==1)
- system("shutdown -s -t 0");
- else if (stime==2)
- system("shutdown -s -t 5");
- else if (stime==3)
- system("shutdown -s -t 30");
- else if (stime==4)
- system("shutdown -s -t 60");
- else if (stime==5)
- system("shutdown -s -t 300");
- else if (stime==6)
- system("shutdown -s -t 1800");
- else if (stime==7)
- system("shutdown -s -t 3600");
- else if (stime==8)
- system("shutdown -s -t 86400");
- else if (stime==0)
- {
- Pause();
- break;
- }
- else
- {
- cout<<"Your entry must be between 0 and 8."<<endl;
- Pause();
- }
- if ((stime!=0)&&(stime>=0)&&(stime<=8))
- {
- cout<<"System is shutting down."<<endl;
- Pause();
- break;
- }
- }
- }
- else if (Num==8)
- {
- system("shutdown -l");
- cout<<"Logging off user."<<endl;
- Pause();
- }
- else if (Num==9)
- {
- while (true)
- {
- system("cls");
- cout<<"Select Restart Delay:"<<endl;
- cout<<"\t0: Cancel"<<endl;
- cout<<"\t1: No Delay"<<endl;
- cout<<"\t2: 5 Second Delay"<<endl;
- cout<<"\t3: 30 Second Delay"<<endl;
- cout<<"\t4: 1 Minute Delay"<<endl;
- cout<<"\t5: 5 Minute Delay"<<endl;
- cout<<"\t6: 30 Minute Delay"<<endl;
- cout<<"\t7: 1 Hour Delay"<<endl;
- cout<<"\t8: 1 Day Delay"<<endl;
- cout<<"Enter Your Choice: ";
- cin>>rtime;
- if (rtime==1)
- system("shutdown -r -t 0");
- else if (rtime==2)
- system("shutdown -r -t 5");
- else if (rtime==3)
- system("shutdown -r -t 30");
- else if (rtime==4)
- system("shutdown -r -t 60");
- else if (rtime==5)
- system("shutdown -r -t 300");
- else if (rtime==6)
- system("shutdown -r -t 1800");
- else if (rtime==7)
- system("shutdown -r -t 3600");
- else if (rtime==8)
- system("shutdown -r -t 86400");
- else if (rtime==0)
- {
- Pause();
- break;
- }
- else
- {
- cout<<"Your entry must be between 0 and 8."<<endl;
- Pause();
- }
- if ((rtime!=0)&&(rtime>=0)&&(rtime<=8))
- {
- cout<<"System is restarting."<<endl;
- Pause();
- break;
- }
- }
- }
- else if (Num==10)
- {
- Xnum=0;
- while ((PWEntered!=AbortPW)&&(Xnum<6))
- {
- system("cls");
- cout<<"Enter the Password to Abort('x' to exit): ";
- cin>>PWEntered;
- if (PWEntered==AbortPW)
- {
- system("shutdown -a");
- cout<<"Shutdown Aborted."<<endl;
- Pause();
- }
- else if (PWEntered=="x")
- {
- Pause();
- break;
- }
- else
- {
- cout<<"The password you entered was incorrect."<<endl;
- Pause();
- }
- Xnum+=2;
- }
- if ((PWEntered!=AbortPW)&&(PWEntered!="x"))
- {
- cout<<endl<<"You failed to enter the correct password."<<endl<<endl<<"GOODBYE"<<endl<<endl;
- return(0);
- }
- }
- else if (Num==11)
- {
- cout<<"GOODBYE"<<endl<<endl;
- break;
- }
- else if ((Num>11) || (Num<0))
- {
- cout<<"The number must be between 0 and 11."<<endl<<endl;
- Pause();
- }
- }
- return(0);
- }
Advertisement
Add Comment
Please, Sign In to add comment