Page 1 of 1
8.1.0 .BAT program Tool Capture Output fail
Posted: Tue Nov 15, 2016 11:13 pm
by chrisjj
Anyone know how to get Tool Capture Output to work on a .BAT program at a variable path?
My variable path is:
With a fixed program path:
Code: Select all
D:\Projects\ChrisJJ\chrisjj.com web\www.chrisjj.com\tango\cjjsets\searchdatagen\!run.bat
output appears in Tool Output EDIT: with no garbage characters.
With that variable program path:
a CMD window appears briefly and no output appears in Tool Output.
The tool is created with Preferences Tools Add Program... and select a .BAT file, as per docs:
Switching to a "DOS" command
http://i.imgur.com/ZcyjGUS.png is not an option since under those conditions captured output shows wrong chars
http://i.imgur.com/oTde0Y0.png due I guess to some codepage muddle.
Posted: Thu Nov 17, 2016 7:50 am
by AmigoJack
Have you tried running it thru the command prompt directly?
cmd.exe /c script.bat
Posted: Thu Nov 17, 2016 11:59 am
by chrisjj
AmigoJack wrote:Have you tried running it thru the command prompt directly?
cmd.exe /c script.bat
Using
:
At an actual CMD prompt, it fails
http://i.imgur.com/9KMh0YD.png as expected.
(At an actual CMD prompt, !run.bat runs
http://i.imgur.com/mJBpuFd.png but give garbage characters as expected from "DOS".)
As a TextPad Tool of the Program type
http://i.imgur.com/9KHFKMJ.png it fails to run
http://i.imgur.com/bOLlKq6.png
As a TextPad Tool of the DOS Command type
http://i.imgur.com/bdsauVA.png is runs, but gives garbage characters in Tool Output
http://i.imgur.com/fSEgWyH.png , as expected from "DOS".
Posted: Thu Nov 17, 2016 1:11 pm
by AmigoJack
chrisjj wrote:As a TextPad Tool of the Program type
it fails to run

This variant only, of course.
And by
CMD.EXE I was implying the full path to the executable, as in
http://forums.textpad.com/viewtopic.php?p=42706#42706 (speak: i.e.
C:\Windows\System32\cmd.exe).
Posted: Thu Nov 17, 2016 2:26 pm
by chrisjj
AmigoJack wrote:This variant only, of course.
I wonder what makes you think no other other variant fails.
That variant:
fails in the same way:
despite:
Does that variant work there?
If not, do you have any solution that works there?
Posted: Thu Nov 17, 2016 2:36 pm
by AmigoJack
chrisjj wrote:I wonder what makes you think no other other variant fails.
I don't understand: we're talking about running a program thru
TextPad, not the command line itself. Hence I consider all your other 3 variants of inappropriate, as they do not relate to the goal.
The command in there is
C:\Windows\System32\cmd.exe.
The parameters in there are
/c "$WspDir\!run.bat".
Think of "command" as file to execute, then it should make more sense to you. Yes, the captions are misleading: either you have a command (which already includes parameters) or you have an executable, which may have parameters.
Posted: Thu Nov 17, 2016 5:43 pm
by chrisjj
AmigoJack wrote:I don't understand: we're talking about running a program thru TextPad, not the command line itself. Hence I consider all your other 3 variants of inappropriate, as they do not relate to the goal.
The two of these these three
http://i.imgur.com/PoFaXDu.png that say "As a TextPad tool" were run as a TextPad tool i.e. through Textpad.
AmigoJack wrote:The command in there is C:\Windows\System32\cmd.exe.
The parameters in there are /c "$WspDir\!run.bat".
Ah! Making that split:
works - runs with no garbage characters:
Thanks!
AmigoJack wrote:Yes, the captions are misleading: either you have a command (which already includes parameters) or you have an executable, which may have parameters.
I'd say the first caption (labels) is plain wrong. "Command:" accepts only a program, so I think should be "Program:". Also misleading is that input format is a string allowing a string like Add DOS Command and not a Open File dialog to program, disallowing a string, like Add Program.
This leaves open the question of why the original fails, esp. since the docs
http://i.imgur.com/9Y5RfTn.png say Tool Parameter Macros are allowed in the so-called Command field. A bug, I guess.
Thanks for your help. Much appreciated!