void __fastcall TForm1::Button1Click(TObject *Sender)
{
TStringList *Archivo = new TStringList;
Archivo->Clear();
if(FileExists("Comando.bat"))
DeleteFile("Comando.bat");
Archivo->Add("Dir c:\ > salida.txt");
Archivo->SaveToFile("comando.bat");
ShellExecute(Handle, "open","comando.bat",0,0,SW_HIDE);
Memo1->Lines->LoadFromFile("salida.txt");
delete Archivo;
}