Board index » delphi » Newbie: :executing dos command in delphi

Newbie: :executing dos command in delphi

can anyone tell me how to execute a dos command in delphi ???

also i need to print an ASCII file to the printer ???
how do i do that???

mail to brun...@imec.be

Thanks

 

Re:Newbie: :executing dos command in delphi


Quote
Jeroen Bruneel wrote:

> can anyone tell me how to execute a dos command in delphi ???

  WinExec (in D1) or CreateProcess (in D2)

Jason

Re:Newbie: :executing dos command in delphi


Quote
Jeroen Bruneel wrote:

> can anyone tell me how to execute a dos command in delphi ???

WinExec

Quote
> also i need to print an ASCII file to the printer ???
> how do i do that???

Open the file using AssignFile,Reset.  Readln and Writeln until Eof.  
CloseFile.

--
Mark.

Re:Newbie: :executing dos command in delphi


JB> can anyone tell me how to execute a dos command in delphi ???
JB> also i need to print an ASCII file to the printer ???
JB> how do i do that???

Use the WinEXEC API call. You can also execute COMMAND.COM with the
/C parameter instead of calling the DOS program directly - it is "safer"
to do it this way under Windoze. ;-)

regards,
Billy

 * RM 1.31 3337 *

Re:Newbie: :executing dos command in delphi


How to catch event if the application under WinExec has finished????

I wonder....

Yours faithfully,

Alvis Koon

Quote
BILLY VERREYNNE (vsl...@onwe.co.za) wrote:

: JB> can anyone tell me how to execute a dos command in delphi ???
: JB> also i need to print an ASCII file to the printer ???
: JB> how do i do that???

: Use the WinEXEC API call. You can also execute COMMAND.COM with the
: /C parameter instead of calling the DOS program directly - it is "safer"
: to do it this way under Windoze. ;-)

: regards,
: Billy

:  * RM 1.31 3337 *

Other Threads