luchifer,
La función ShellExecute debería funcionar de esta forma:
Código Delphi
[-]
var
s1 : String;
s2 : array[0..255] of char;
begin
s1 := '/C bcp "select * from bd_cona..cta where asoc in (select cod from bd_cona..ltablas where tab='+car+'ASO'+car+' and tiene='+car+'1'+car+')" queryout Bcta.txt -c -T';
StrPCopy(s2,s1);
ShellExecute(0, nil, 'cmd.exe',s2, nil, SW_HIDE);
end;
Espero sea útil
Nelson.