Try the Sys method instead, you don't need any of that std::string stuff, just String works fine:
#include <Core/Core.h>
using namespace Upp;
CONSOLE_APP_MAIN {
String output;
Sys("ls -la", output);
Vector<String> lines = Split(output, "\n");
int i = 1;
for(auto& line : lines) {
Cout() << Format("Line #%d: %s\n", i, line);
i++;
}
}
Sys will run the command and store the results in the output variable. Split will create an array of Strings that you can loop through on newline or you can choose an alternative delimiter. If you need anything more complex than that try looking up CParser (https://www.ultimatepp.org/src$Core$CParser_en-us.html), it can help you write a hand parser. Regexps are also available (https://www.ultimatepp.org/reference$RegExp$en-us.html).
I don't have Windows installed but if you replace "ls -la" with "dir" that example should get you going.