Advertisement
Guest User

Executer (Release 1)

a guest
Feb 20th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.56 KB | None | 0 0
  1. #include <iostream>
  2. #include <windows.h>
  3.  
  4. using namespace std;
  5.  
  6. int main()
  7. {
  8.     // Set text color to red, thanks to Windows.h
  9.     SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_INTENSITY);
  10.  
  11.     // Obligatory ASCII art welcome screen
  12.     cout << "d88888b db    db d88888b  .o88b. db    db d888888b d88888b d8888b. " << endl;
  13.     cout << "88'     `8b  d8' 88'     d8P  Y8 88    88 `~~88~~' 88'     88  `8D " << endl;
  14.     cout << "88ooooo  `8bd8'  88ooooo 8P      88    88    88    88ooooo 88oobY' " << endl;
  15.     cout << "88~~~~~  .dPYb.  88~~~~~ 8b      88    88    88    88~~~~~ 88`8b   " << endl;
  16.     cout << "88.     .8P  Y8. 88.     Y8b  d8 88b  d88    88    88.     88 `88. " << endl;
  17.     cout << "Y88888P YP    YP Y88888P  `Y88P' ~Y8888P'    YP    Y88888P 88   YD " << endl;
  18.     cout << endl;
  19.     cout << "\"There are few sources of energy so powerful as a procrastinating " << endl;
  20.     cout << "high-school programmer.\"" << endl;
  21.     cout << endl;
  22.  
  23.     // Mimic Linux CLI feel and initialize / get command variable
  24.     cout << "Command Line@Executer2:~$ ";
  25.     string command;
  26.     getline(cin, command);
  27.  
  28.     cout << endl;
  29.     cout << endl;
  30.  
  31.     // Pass in command to system(), using .c_str(), which allows strings to be passed into system()
  32.     system(command.c_str());
  33.     cout << endl;
  34.  
  35.     // Infinite loop
  36.     while (true)
  37.     {
  38.         cout << endl;
  39.         cout << endl;
  40.         cout << "Command Line@Executer2:~$ ";
  41.         getline(cin, command);
  42.         system(command.c_str());
  43.     }
  44.     return 0;
  45. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement