Executar comandos Shell em C++

Publicado: 28 de janeiro de 2014 em C/C++

O C++ permite executar uma linha de comando usando a função SYSTEM que está na biblioteca   padrão de C (stdlib.h) e de C++ (cstdlib).

#include "stdafx.h"

#include <stdlib.h>

int _tmain(int argc, _TCHAR* argv[])

{

system("Color 17");

system("dir c:");

system("pause");

return 0;

}

Deixe um comentário