A question about BAT
I've seen this script before I just don't know what to query Google for. It's a script that runs and shows like a normal cmd prompt you type in a command and it executes it within itself and when the commands ends it jumps back to the start of the batch. (I need to be able to get into cmd wherever I am).
mastergamer wrote: Write a C++ program that get input and then passes that to a system() call?
I just quickly wrote up a program that did this.. it's called Comandeer (uhh I had to give it something for a name LOL)
anyway here.. you can download it (Either one)
http://www.sendspace.com/file/78ztnn http://www.uploading.com/files/I7ML70GY/Comandeer.exe.html
Ohh right. here it is: (Extremely basic BTW)
#include <iostream>
#include <string>
int main()
{
using namespace std;
string Input = "NULL";
cout << "Enter the command to execute: ";
cin >> Input;
system(Input.c_str());
cout << endl;
system("PAUSE");
return 0;
}
Ping doesn't work btw LOL
EDIT: I've found out what you can do.. instead of trying to directly ping something from this program.. Just type cmd… then you can do whatever.
Also made a version that just directly opens the command prompt…
Source:
#include <iostream>
int main()
{
system("cmd");
std::cout << std::endl;
system("PAUSE");
return 0;
}
Download: http://www.uploading.com/files/OB4G38FU/Comandeer2.exe.html http://www.sendspace.com/file/wfnai3