It is just the same, a string variable or string constant produce exactly the same results. However, you need to add some code to check exactly what is contained in the string before you pass it to system, to protect from hacking. Something like:
string strCommand;
cin >> strCommand;
system(strCommand.c_str());