Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <windows.h>
- using namespace std;
- int main()
- {
- // Set text color to red, thanks to Windows.h
- SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_RED | FOREGROUND_INTENSITY);
- // Obligatory ASCII art welcome screen
- cout << "d88888b db db d88888b .o88b. db db d888888b d88888b d8888b. " << endl;
- cout << "88' `8b d8' 88' d8P Y8 88 88 `~~88~~' 88' 88 `8D " << endl;
- cout << "88ooooo `8bd8' 88ooooo 8P 88 88 88 88ooooo 88oobY' " << endl;
- cout << "88~~~~~ .dPYb. 88~~~~~ 8b 88 88 88 88~~~~~ 88`8b " << endl;
- cout << "88. .8P Y8. 88. Y8b d8 88b d88 88 88. 88 `88. " << endl;
- cout << "Y88888P YP YP Y88888P `Y88P' ~Y8888P' YP Y88888P 88 YD " << endl;
- cout << endl;
- cout << "\"There are few sources of energy so powerful as a procrastinating " << endl;
- cout << "high-school programmer.\"" << endl;
- cout << endl;
- // Mimic Linux CLI feel and initialize / get command variable
- cout << "Command Line@Executer2:~$ ";
- string command;
- getline(cin, command);
- cout << endl;
- cout << endl;
- // Pass in command to system(), using .c_str(), which allows strings to be passed into system()
- system(command.c_str());
- cout << endl;
- // Infinite loop
- while (true)
- {
- cout << endl;
- cout << endl;
- cout << "Command Line@Executer2:~$ ";
- getline(cin, command);
- system(command.c_str());
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement