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?
Stdout not working with RunProgram
Moderators: JRL, Dorian (MJT support)
Re: Stdout not working with RunProgram
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.
http://zbar.sourceforge.net/
and they have a sample file.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1417
- Joined: Sun Nov 03, 2002 3:19 am
Re: Stdout not working with RunProgram
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 :
Of course change /k to /c and -v to -q once you have it working.
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
Re: Stdout not working with RunProgram
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.
- Dorian (MJT support)
- Automation Wizard
- Posts: 1417
- Joined: Sun Nov 03, 2002 3:19 am
Re: Stdout not working with RunProgram
Odd. The single line of code worked here just fine.