8.1.0 .BAT program Tool Capture Output fail

General questions about using TextPad

Moderators: AmigoJack, bbadmin, helios, Bob Hansen, MudGuard

Post Reply
chrisjj
Posts: 149
Joined: Sat Jan 21, 2006 10:32 pm

8.1.0 .BAT program Tool Capture Output fail

Post by chrisjj »

Anyone know how to get Tool Capture Output to work on a .BAT program at a variable path?

My variable path is:

Code: Select all

"$WspDir\!run.bat"
With a fixed program path:

Code: Select all

D:\Projects\ChrisJJ\chrisjj.com web\www.chrisjj.com\tango\cjjsets\searchdatagen\!run.bat
Image

output appears in Tool Output EDIT: with no garbage characters.

With that variable program path:

Code: Select all

"$WspDir\!run.bat"
Image

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:

Image

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.
Last edited by chrisjj on Thu Nov 17, 2016 12:08 pm, edited 1 time in total.
User avatar
AmigoJack
Posts: 532
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Post by AmigoJack »

Have you tried running it thru the command prompt directly?
cmd.exe /c script.bat
chrisjj
Posts: 149
Joined: Sat Jan 21, 2006 10:32 pm

Post by chrisjj »

AmigoJack wrote:Have you tried running it thru the command prompt directly?
cmd.exe /c script.bat
Using

Code: Select all

cmd.exe /c "$WspDir\!run.bat"
:

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".
User avatar
AmigoJack
Posts: 532
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Post by AmigoJack »

chrisjj wrote:As a TextPad Tool of the Program type
Image
it fails to run
Image
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).
chrisjj
Posts: 149
Joined: Sat Jan 21, 2006 10:32 pm

Post by chrisjj »

AmigoJack wrote:This variant only, of course.
I wonder what makes you think no other other variant fails.
AmigoJack wrote: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).
That variant:

Image

fails in the same way:

Image

despite:

Image

Does that variant work there?

If not, do you have any solution that works there?
User avatar
AmigoJack
Posts: 532
Joined: Sun Oct 30, 2016 4:28 pm
Location: グリーン ヒル ゾーン
Contact:

Post 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.
chrisjj
Posts: 149
Joined: Sat Jan 21, 2006 10:32 pm

Post 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:

Image

works - runs with no garbage characters:

Image

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!
Post Reply