COMSPEC incompatibility - v9 is different than v7

May 21, 2008
21
0
#1
(Quick question, what's the simplest way to get ComSpec set correctly launching cmd.exe from v9?)

Using the command
Code:
start cmd
Take Command 7.01.370 produces a command shell with
Code:
ComSpec=C:\WINDOWS\system32\cmd.exe
Take Command 9.02.151 produces a command shell with
Code:
ComSpec=C:\jp\v9\tcc.exe
Because of this, trying to get full CMD-compatibility by running a .cmd file using cmd.exe fails under v9.

Also somewhere along the line of running a batch - that had worked correctly from a cmd.exe launched from TCmd 7 - an error dump dialog appeared:

Code:
OS: Windows XP Professional, SP2
CPU: AuthenticAMD, AMD AMD Athlon(tm) 64 X2 Dual Core Processor 4400+, MMX @ 2220 MHz

Module name: C:\jp\v9\tcc.exe

Application data:
VmVyc2lvbjogV2xWamFXWWpSMnRvYUdkb1kxb2tLRkl3SkRvNUpUMDV
QRkFpTGdJRlN5SS9KVEp3Wm5wNGNEVWxKRGdsSVRoYWZHMTdSemM3Uj
FaTlBVMXhlV3RYUVZORWZ3dz0NCkltYWdlQmFzZTogMTAwMDAwMDANC
i0xDQpDb2RlID0gWzExNF0NCi0gMjIxDQotIDANCi0gMjE3DQotIDAN
Ci0gMA0KLSBbXQ0KPiBDOlxqcFx2OVx0Y2MuZXhlDQoNCkpQIFNvZnR
3YXJlDQpUQ0MNCjkuMDIuMTUxDQpUQ0MNCkNvcHlyaWdodCAoYykgMj
AwOCBSZXggQy4gQ29ubiBhbmQgSlAgU29mdHdhcmUgSW5jLg0KVGFrZ
SBDb21tYW5kIGlzIGEgdHJhZGVtYXJrIG9mIEpQIFNvZnR3YXJlIElu
Yy4NClRDQw0KOS4wMi4xNTENClRDQw0KDQo+IEM6XFdJTkRPV1Ncc3l
zdGVtMzJcbnRkbGwuZGxsDQo+IEM6XFdJTkRPV1Ncc3lzdGVtMzJca2
VybmVsMzIuZGxsDQo+IEM6XGpwXHY5XFRha2VDbWQuZGxsDQoNCkpQI
FNvZnR3YXJlDQpUYWtlQ21kDQo5LjAyLjE1MQ0KV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LmRsbA0KPiBDOlxXSU5ET1dTXHN5c3Rl
bTMyXHhwc3AycmVzLmRsbA0KPiBDOlxqcFx2OVxFbmdsaXNoLmRsbA0
KDQpKUCBTb2Z0d2FyZQ0KRW5nbGlzaCBsYW5ndWFnZSBkbGwNCjkuMD
IuMTUxDQpFbmdsaXNoLkRMTA0KQ29weXJpZ2h0IChjKSAyMDA4IFJle
CBDLiBDb25uIGFuZCBKUCBTb2Z0d2FyZSBJbmMuDQpUYWtlIENvbW1h
bmQgaXMgYSByZWdpc3RlcmVkIHRyYWRlbWFyayBvZiBKUCBTb2Z0d2F
yZSBJbmMuDQpFbmdsaXNoLkRMTA0KOS4wMi4xNTENCkVuZ2xpc2guRE
xMDQo=
-- Timothy
{vent}It's things like this that remind me why I used TakeCommand to the exclusion of 4NT.{/vent}
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,588
46
Albuquerque, NM
prospero.unm.edu
#2
(Quick question, what's the simplest way to get ComSpec set correctly launching cmd.exe from v9?)

Using the command
Code:
start cmd
Take Command 7.01.370 produces a command shell with
Code:
ComSpec=C:\WINDOWS\system32\cmd.exe
Take Command 9.02.151 produces a command shell with
Code:
ComSpec=C:\jp\v9\tcc.exe
Because of this, trying to get full CMD-compatibility by running a .cmd file using cmd.exe fails under v9.
IIRC, pre-v9 Take Command did not create or use a COMSPEC variable....

I imagine the simplest way would be to do something like:

Code:
set comspec=%@search[cmd.exe]
start cmd.exe
set comspec=%_cmdspec
Or omit the second SET COMSPEC, and instead wrap it in a SETLOCAL / ENDLOCAL pair.
 
May 30, 2008
122
1
#4
2008/6/14 Charles Dye <>:

> IIRC, pre-v9 Take Command did not create or use a COMSPEC variable....
You mean it does now? How does it use COMSPEC? The help mentions that
TCC sets it (which I'm not convinced is a good thing, particularly if
it never uses it) but says nothing about it being used for anything.

Paul.
 

Charles Dye

Super Moderator
Staff member
May 20, 2008
3,588
46
Albuquerque, NM
prospero.unm.edu
#5
2008/6/14 Charles Dye <>:

You mean it does now? How does it use COMSPEC? The help mentions that
TCC sets it (which I'm not convinced is a good thing, particularly if
it never uses it) but says nothing about it being used for anything.
I don't believe TCC uses it, as e.g. COMMAND.COM did; but external programs may rely on it.
 

rconn

Administrator
Staff member
May 14, 2008
10,533
94
#6
Timothy Byrd wrote:

> (Quick question, what's the simplest way to get ComSpec set correctly
> launching cmd.exe from v9?)
>
> Using the command
> Code:
>
> start cmd
>
> Take Command 7.01.370 produces a command shell with
> Code:
>
> ComSpec=C:\WINDOWS\system32\cmd.exe
>
> Take Command 9.02.151 produces a command shell with
> Code:
>
> ComSpec=C:\jp\v9\tcc.exe
>

> Because of this, trying to get full CMD-compatibility by running a .cmd
> file using cmd.exe fails under v9.
Take Command isn't doing this; TCC is. Take Command never sets COMSPEC,
and it only references COMSPEC if you start a new tab with no command
specified.

If you want to run CMD in TCMD v9, the easiest way to do it is to have a
CMD tab window running. You can do that either with a startup tab or by
creating a toolbar button.

If you want to start a non-tabbed copy of CMD from a tabbed TCC window
so that it doesn't have the COMSPEC pointing to TCC, you can use the
START /I option. (Or create a toolbar button!)


> Also somewhere along the line of running a batch - that had worked
> correctly from a cmd.exe launched from TCmd 7 - an error dump dialog
> appeared:
Is this reproducible?

Rex Conn
JP Software
 

rconn

Administrator
Staff member
May 14, 2008
10,533
94
#7
Timothy Byrd wrote:


> Also somewhere along the line of running a batch - that had worked
> correctly from a cmd.exe launched from TCmd 7 - an error dump dialog
> appeared:
Also, note that TCMD v9 will create a TCMD.GPF file (or TCC.GPF,
depending on where the error occurred), which (unlike the Windows dump)
is actually useful in tracing the cause of the error. If you have one
(in your installation directory) please email it to me.

Rex Conn
JP Software
 
May 21, 2008
21
0
#8
Sorry I took a while to respond - it takes me half an hour to get to the point where I can reproduce it, and I just now had the time.

I got thinking it wasn't reproducible, but it just happened again. I didn't find a .gpf file. Do you want the base64-encoded dump?

-- T
 

rconn

Administrator
Staff member
May 14, 2008
10,533
94
#9
Timothy Byrd wrote:

> Sorry I took a while to respond - it takes me half an hour to get to the
> point where I can reproduce it, and I just now had the time.
>
> I got thinking it wasn't reproducible, but it just happened again. I
> didn't find a .gpf file. Do you want the base64-encoded dump?
The .GPF file will be created in the %localappdata/jpsoft directory (the
same as the TCMD.INI default location). If you can't find it you can
send the dump (though it's too limited to usually be of any use).

Rex Conn
JP Software