PDA

Ver la Versión Completa : ejecutar un .bat Como?


pruz
02-12-2003, 17:51:05
hola amigos,

no se como utilizar el shellexecute u otra instruccion para ejecutar un programa .bat, trate de usar el mencioando y no encuentra la funcion, trabajo con delphi 6

Saludos,
Pruz

Nadie
02-12-2003, 18:09:08
(...)
uses shellapi;
(...)
begin
shellexecute(handle,nil,'notepad.exe',nil,nil,sw_shownormal);
end;
(...)

pruz
02-12-2003, 18:22:07
Gracias Nadie por responder,

pero me aparece error

var
xx : string;
begin

xx := rutaflex + 'cuentas.bat';
Shellexecute(handle,nil, xx ,nil,nil,sw_shownormal);


end;

[Error] UDetCosto.pas(120): Incompatible types: 'String' and 'PChar'

que hacer
Gracias

__cadetill
02-12-2003, 19:00:23
pruz comentó:
var
xx : string;
begin

xx := rutaflex + 'cuentas.bat';
Shellexecute(handle,nil, PChar(xx) ,nil,nil,sw_shownormal);


end;

pruz
02-12-2003, 19:23:45
gracias, entendido,