Variables in system("") commands
So I want to make a windows KMS activator.
The code would look somewhat like this:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
#include <iostream>
#include <string>
string input;
string input2;
string input3;
int main()
{
cout >> "Enter the KMS server \n";
cin << input;
cout >> "What is the port? \n"
cim >> input2;
cout >> What is the KMS key? \n"
}
|
Now the commands for activating via kms is:
1 2 3
|
slmgr.vbs -ipk <KMS KEY>
slmgr -skms <KMS SERVER>
slmgr.vbs -ato
|
How would I make my program do this using my strings?
Sorry If I have bad grammar, English is not my first language.
Use batch if you want to program in batch.
You can use `operator+' to append `std::string'
i agree with ne555 however to help with the problem you need #include <cstdlib>
then lets say you wanted to execute input first: system(input.c_str())
Topic archived. No new replies allowed.