[Lazarus] runcommand doesn't work?

zeljko zeljko at holobit.hr
Fri Mar 10 09:38:51 CET 2023



On 10. 03. 2023. 02:28, john Ward via lazarus wrote:
> *I have a program, segment included below, that partially works.  The 
> first 'runcommand' example works, but the 2nd doesn't?*
> *If I type the lp command line, it prints perfectly..*
>   if RunCommand('unix2dos', ['-n', '-f', 
> '/mbs/mbs/file/cust.f','/mbs/mbs/file/cust.frm'],s) then
>   writeln(s);
>    if RunCommand('/bin/lp', ['-d', ' printer1','-o=raw' 
> ,'/mbs/mbs/file/cust.frm'], s) then
>    writeln(s);
>    errormsg.text := 'We are done with runcommand now s= '+ s;
> *Fedora 37, Lazarus 2.2.4 FPC 3.2.2  X64 Linux gtk2*

Are you sure that lp is in /bin directory ?
Try lp instead of /bin/lp (if cmd lp works)

zeljko


More information about the lazarus mailing list