OS2 World Community Forum
OS/2, eCS & ArcaOS - Technical => Programming => Topic started by: Per E. Johannessen 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?
-
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:
ADDRESS CMD "P:\test\pdftotext.exe source.PDF input.txt"
Plus any output redirection you need, of course.
-
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
-
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
-
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).
-
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.
-
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.
-
Thanks to Dave Yeo, who built version 4.01, the new pdftotext now works from VX-Rexx as well.
-
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.