Author Topic: Start program from VX-Rexx  (Read 1173 times)

Per E. Johannessen

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +3/-0
    • View Profile
Start program from VX-Rexx
« on: March 22, 2024, 09:54:21 pm »
Hi,

I have a cmd file with this line;

address cmd.exe "start /C /min P:\test\pdftotext.exe source.PDF input.txt"

and it works fine (converting the pdf to txt).

Trying to run the same line in VX-Rexx is not working.

Got some good tips in the below thread:

https://www.os2world.com/forum/index.php/topic,2932.msg32804.html#msg32804

I've tried any "combination" I could think of but no success.
At one point I got the error message "private_alloc failed, error code = 0x00000137".

Anyone who knows how to get it to work in VX-Rexx?

Alex Taylor

  • Sr. Member
  • ****
  • Posts: 389
  • Karma: +5/-0
    • View Profile
Re: Start program from VX-Rexx
« Reply #1 on: March 22, 2024, 11:20:30 pm »
1. Don't put .exe after cmd, I'm pretty sure it's a keyword command, not a reference to cmd.exe
2. Don't use 'start', running a program with address cmd (at least from VXREXX) will already start a separate session (and minimize it, IIRC).

The following should suffice for running a program from VX-REXX:
Code: [Select]
ADDRESS CMD "P:\test\pdftotext.exe source.PDF input.txt"
Plus any output redirection you need, of course.

Remy

  • Hero Member
  • *****
  • Posts: 646
  • Karma: +9/-1
    • View Profile
Re: Start program from VX-Rexx
« Reply #2 on: March 23, 2024, 11:44:51 am »
Hi,

I have a cmd file with this line;

address cmd.exe "start /C /min P:\test\pdftotext.exe source.PDF input.txt"

and it works fine (converting the pdf to txt).

Trying to run the same line in VX-Rexx is not working.

Got some good tips in the below thread:

https://www.os2world.com/forum/index.php/topic,2932.msg32804.html#msg32804

I've tried any "combination" I could think of but no success.
At one point I got the error message "private_alloc failed, error code = 0x00000137".

Anyone who knows how to get it to work in VX-Rexx?

I didn't try this but may be you can try it:
'@start cmd /c start "pdftotext" /b/k '||your_program

Per E. Johannessen

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +3/-0
    • View Profile
Re: Start program from VX-Rexx
« Reply #3 on: March 23, 2024, 02:48:49 pm »
Thanks, but I can't get any of the suggestions to work.

ADDRESS CMD "P:\test\pdftotext.exe source.PDF input.txt"
Results in "private_alloc failed, error code = 0x00000137

'@start cmd /c start "pdftotext" /b/k '||your_program
Results in "invalid expression"

In another project this is working fine:
address cmd.exe "start /C /min d:\gs\GS9.15\BIN\gsos2


Alex Taylor

  • Sr. Member
  • ****
  • Posts: 389
  • Karma: +5/-0
    • View Profile
Re: Start program from VX-Rexx
« Reply #4 on: March 23, 2024, 10:38:15 pm »
ADDRESS CMD "P:\test\pdftotext.exe source.PDF input.txt"
Results in "private_alloc failed, error code = 0x00000137

Actually, I think this is probably an error from pdftotext.exe itself (or rather, its C runtime).

Does it depend on DLLs or other support files in its current directory? If so, you might need to change the current working directory (or possibly even manipulate the path/libpath/dpath etc).

Per E. Johannessen

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +3/-0
    • View Profile
Re: Start program from VX-Rexx
« Reply #5 on: March 24, 2024, 12:23:54 am »
When running a cmd-file with only the line below it works ok.
address cmd "start /C /min P:\test\pdftotext.exe source.PDF input.txt"

I've tested a few other programs from VX-Rexx using "address cmd" and they work.

pdftotext.exe is in the same directory as the VX-Rexx project and the cmd-file.

I've also copied the cmd-file and pdftotext.exe other directiories and it still works so I assume it
does not depend on any other dll.

Per E. Johannessen

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +3/-0
    • View Profile
Re: Start program from VX-Rexx
« Reply #6 on: March 25, 2024, 04:14:54 pm »
Now I've also tested running the command below from DBExpert;

address cmd "start /C /min P:\test\pdftotext.exe source.PDF input.txt"

At one point it actually worked and produced a nice input.txt, actually the best so far since it
handled the special character 'ΓΈ' correctly.
Funny thing is that it worked only one time.
Have tried lots of times and don't even get any error messages.

Per E. Johannessen

  • Sr. Member
  • ****
  • Posts: 251
  • Karma: +3/-0
    • View Profile
Re: Start program from VX-Rexx
« Reply #7 on: March 27, 2024, 11:24:55 pm »
Thanks to Dave Yeo, who built version 4.01, the new pdftotext now works from VX-Rexx as well.

Dave Yeo

  • Hero Member
  • *****
  • Posts: 4811
  • Karma: +100/-1
    • View Profile
Re: Start program from VX-Rexx
« Reply #8 on: March 28, 2024, 03:46:49 am »
Thanks to Dave Yeo, who built version 4.01, the new pdftotext now works from VX-Rexx as well.

Actually 4.05, the latest. Good that it works for you.