Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Batchparameter containing equal sign

Sep
5
0
Hello,

til today I'm using 4NT 4.01 and I test TCC LE 9,02.152 version!

I think I found a bug or an incompatability to 4NT version!

I cannot call a batch with equal sign in a parameter!

for example:

****** testbatch.btm ********
@echo off
echo count:%#:
echo all:%$:
echo 1:%1:
echo 2:%2:
echo 3:%3:
echo 4:%4:
****** testbatch.btm ********

calling testbatch with the following cal
testbatch a=1 "b=2" `c=3`
will produce the following output

count:4:
all:a 1 "b=2" c=3:
1:a:
2:1:
3:"b=2":
4:c=3:

Why do I have to quote the parameters with backticks?
It's inkomaptibel to the 4NT version!

How can I avoid this needed quoting?

Can anyone give me a hint!

best regards

ente59
 
I think I found a bug or an incompatability to 4NT version!

I cannot call a batch with equal sign in a parameter!

It's inkomaptibel to the 4NT version!

The behavior was deliberately changed, for compatibility with CMD.EXE. (This is often the reason when some sensible behavior is replaced with a peculiar one....)
 
The behavior was deliberately changed, for compatibility with CMD.EXE. (This is often the reason when some sensible behavior is replaced with a peculiar one....)

I don't understand this, cause with CMD.EXE all works as expected (the same as with 4nt)

I renamed testbacht.btm to testbatch.bat

I call testbatch with the following call
testbatch a=1 "b=2" `c=3`
will produce the following output

Y:\cmd>ver
Microsoft Windows XP [Version 5.1.2600]
Y:\cmd>testbatch a=1 b=2 c=3
count:3:
all:a=1 b=2 c=3:
1:a=1:
2:b=2:
3:c=3:
4::
Y:\cmd>

any comments?

best regards

ente59
 
ente59 wrote:
| ---Quote (Originally by Charles Dye)---
| The behavior was deliberately changed, for compatibility with
| CMD.EXE. (This is often the reason when some sensible behavior is
| replaced with a peculiar one....) ---End Quote---
|
| I don't understand this, cause with CMD.EXE all works as expected
| (the same as with 4nt)
| ...
| any comments?

I never use CMD, so I hate such changes. However, the name CMD.EXE refers to
many different versions of that program. It is possible that the one which
changed is in a later version of WinXP than you use (are you on SP3?), or it
affects only Vista. IIRC the change was made in 4NT 8 already (I may be
wrong about that). There were numerous messages in the old NG about it.
--
Steve
 
I never use CMD, so I hate such changes. However, the name CMD.EXE refers to
many different versions of that program. It is possible that the one which
changed is in a later version of WinXP than you use (are you on SP3?), or it
affects only Vista. IIRC the change was made in 4NT 8 already (I may be
wrong about that). There were numerous messages in the old NG about it.

We are still on WinXP SP2 with all MS patches installed
my cmd.exe ist dated the following
4.08.2004 1:57 401.408 cmd.exe

So perhaps this "old" change for cmd.exe was not correct!

What can I do to get the correct (expected) behaviour!

best regards

ente59
 
I don't understand this, cause with CMD.EXE all works as expected (the same as with 4nt)

I renamed testbacht.btm to testbatch.bat

I call testbatch with the following call
testbatch a=1 "b=2" `c=3`
will produce the following output

Y:\cmd>ver
Microsoft Windows XP [Version 5.1.2600]
Y:\cmd>testbatch a=1 b=2 c=3
count:3:
all:a=1 b=2 c=3:
1:a=1:
2:b=2:
3:c=3:
4::
Y:\cmd>

any comments?

It's very strange that your CMD.EXE seems to support %# and %$....

Here, using Windows XP SP3, I get:

Code:
c:\>type testbatch.bat
@echo off
echo count:%#:
echo all:%$:
echo 1:%1:
echo 2:%2:
echo 3:%3:
echo 4:%4:
 
c:\>ver
 
Microsoft Windows XP [Version 5.1.2600]
 
c:\>testbatch a=1 b=2 c=3
count:
all:
1:a:
2:1:
3:b:
4:2:
 
c:\>
 
ente59 wrote:
| ---Quote (Originally by Steve Fábián)---
| I never use CMD, so I hate such changes. However, the name CMD.EXE
| refers to many different versions of that program. It is possible
| that the one which changed is in a later version of WinXP than you
| use (are you on SP3?), or it affects only Vista. IIRC the change was
| made in 4NT 8 already (I may be wrong about that). There were
| numerous messages in the old NG about it. ---End Quote---
|
| We are still on WinXP SP2 with all MS patches installed
| my cmd.exe ist dated the following
| 4.08.2004 1:57 401.408 cmd.exe
|
| So perhaps this "old" change for cmd.exe was not correct!
|
| What can I do to get the correct (expected) behaviour!

Ask MS to change their code, and JPsoft will do likewise.
--
Steve
 
ente59 wrote:

>
> Quote:
> Originally Posted by *Charles Dye* View Post
> <showthread.php?p=2093#post2093>
> The behavior was deliberately changed, for compatibility with CMD.EXE.
> (This is often the reason when some sensible behavior is replaced with a
> peculiar one....)
>
> I don't understand this, cause with CMD.EXE all works as expected (the
> same as with 4nt)
>
> I renamed testbacht.btm to testbatch.bat
>
> I call testbatch with the following call
> testbatch a=1 "b=2" `c=3`
> will produce the following output
>
> Y:\cmd>ver
> Microsoft Windows XP [Version 5.1.2600]
> Y:\cmd>testbatch a=1 b=2 c=3
> count:3:
> all:a=1 b=2 c=3:
> 1:a=1:
> 2:b=2:
> 3:c=3:
> 4::
> Y:\cmd>
>
> any comments?

Note that CMD does not support the %# and %$ variables, so if you're
getting a value from them you're not really running CMD.

.BAT files are executed by the Windows COMMAND.COM (which is a stub that
does a few things internally but calls CMD or TCC to do the bulk of its
work).

Try renaming your test file to TESTBATCH.CMD, run it in TCC, then type
"CMD" at the TCC command line and run it again.

Here I see:

TCC:

[C:\TakeCommand10]testbatch a=1 "b=2" `c=3`
count:4:
all:a 1 "b=2" c=3:
1:a:
2:1:
3:"b=2":
4:c=3:

CMD:

C:\TakeCommand10>testbatch a=1 "b=2" `c=3`
count:

all:

1:a:

2:1:

3:"b=2":

4:`c:


The output is the same with the exception that CMD doesn't recognize the
single back quote for #4.

Rex Conn
JP Software
 
K_Meinhard wrote:
| Steve FXbiXn wrote:
|
|
|
| ---Quote---
||| What can I do to get the correct (expected) behaviour!
| ---End Quote---
|
|
| ---Quote---
|| Ask MS to change their code, and JPsoft will do likewise.
| ---End Quote---
| Don't you think that Rex should answer this question?

The original question was asked and answered by Rex several times in the
past. Charles Dye, responding to the original post, explained why the
behavior changed. The question in the above quote is polemical - when a
program behaves as intended by its author, its behavior is correct by
definition, regardless of what any one user expects (or any million users).
Short of regresssing the change - which would be done if Microsoft regressed
their change - there is no method to achieve the older behavior with the
newer software. This is the answer Rex is most likely to give.

IIRC you, Klaus, also answered questions in the past stating that there is
no method to achieve certain specific goals.
--
Steve
 

Similar threads

Back
Top