Stdout not working with RunProgram

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Stdout not working with RunProgram

Post by kpassaur » Tue Dec 17, 2019 8:44 pm

I am having difficulty with stdout. I have a program that with this line

"c:\temp3\zbarimg.exe" -q "c:\temp3\1.tif" > "c:\temp3\contents.txt"

I can run the program from anywhere with the command prompt. All dependencies are in the folder with the program. When I run it from MS I get nothing. I have tried changing to the directory first but that made no difference (and it would cause issues later) I have tried running it like this as well

RunProgram>"c:\temp3\zbarimg.exe" -q "c:\temp3\1.tif" > "c:\temp3\contents.txt"

RunProgram>cmd /C "c:\temp3\zbarimg.exe" -q "c:\temp3\1.tif" > "c:\temp3\contents.txt"

Is there any other way it can be run? perhaps with VBScript? if so how?

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Re: Stdout not working with RunProgram

Post by kpassaur » Tue Dec 17, 2019 10:57 pm

If you think you can to it or want a challenge the program is here:
http://zbar.sourceforge.net/
and they have a sample file.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Stdout not working with RunProgram

Post by Dorian (MJT support) » Wed Dec 18, 2019 1:03 pm

Is it possible you're missing the \bin from the path?

I just tested the following with the attached image, and it created the attached contents.txt file :

Code: Select all

RunProgram>CMD /k d:\zbar\bin\zbarimg.exe -v d:\zbar\bar2.jpg > d:\zbar\contents.txt
Of course change /k to /c and -v to -q once you have it working.
Yes, we have a Custom Scripting Service. Message me or go here

kpassaur
Automation Wizard
Posts: 696
Joined: Wed Jul 07, 2004 1:55 pm

Re: Stdout not working with RunProgram

Post by kpassaur » Wed Dec 18, 2019 1:19 pm

No as it worked outside of MS. For a fix I now write the line with a ".bat" extension and then execute the bat file. Works like a charm now. Doing it like this also allows GhostScript to add in leading 0's. To do it you need to add a percent sign and when you do your variable fails in MS. If you assign it to a variable such as Let>per=% and use that it will put in blank spaces in a file name but running it as a bat file will not. Thank you for the follow up.

User avatar
Dorian (MJT support)
Automation Wizard
Posts: 1348
Joined: Sun Nov 03, 2002 3:19 am
Contact:

Re: Stdout not working with RunProgram

Post by Dorian (MJT support) » Wed Dec 18, 2019 1:44 pm

Odd. The single line of code worked here just fine.
Yes, we have a Custom Scripting Service. Message me or go here

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts