Bug: Some internal commands return a dialog box

English support forum

Moderators: Hacker, petermad, Stefan2, white

icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

So please tell me the disadvantage of %comspec% /k towards noclose.pif.

Icfu
This account is for sale
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

Hmm, the /k stops me from closing the console window using Alt-F4, as opposed to /c, for instance...

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

You will have two ways to start a command shell in the future:

Entering a command and pressing ENTER launches cmd /k command.
Entering a command and pressing SHIFT-ENTER launches cmd /c command.

Or vice versa via wincmd.ini setting:
ComspecShiftSwitch=1/0

Ok?

Icfu
User avatar
Hacker
Moderator
Moderator
Posts: 13142
Joined: 2003-02-06, 14:56 UTC
Location: Bratislava, Slovakia

Post by *Hacker »

You can't close Shift-Enter noclose.pif-box with Alt-F4, too, no difference.
Bet?
Entering a command and pressing ENTER launches cmd /k command.
Entering a command and pressing SHIFT-ENTER launches cmd /c command
Well, I don't have a "cmd" on my system... ;) (You have to be consequent when saying %comspec%...)

Roman
Mal angenommen, du drückst Strg+F, wählst die FTP-Verbindung (mit gespeichertem Passwort), klickst aber nicht auf Verbinden, sondern fällst tot um.
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Yeah, when I say cmd it's just because I am used to it. I like it short and simple.

The rest I deleted already, sorry for that. ;)

You will be able to close your %comspec% /k command.com window just the same way you are able to do now so nothing will change, am I missing something?
Seems I'm getting confused...

Please explain:
What is the difference between currently pressing Shift-Enter starting noclose.pif and starting %comspec% /k in the future?

Icfu
foxidrive
Junior Member
Junior Member
Posts: 90
Joined: 2004-02-28, 11:50 UTC

Post by *foxidrive »

You will have two ways to start a command shell in the future:
Is this official? (asks he, hopefully) :)

Here are some further problems with using noclose.pif under Windows NT.

Say you enter %windir%\NoClose2.bat in the "cmd line:" in the pif file, and use one of these lines in NoClose2.bat, you will find that only the first two work correctly, assuming a standard Windows install (tested under XP).

c:\windows\system32\cmd.exe /k %2 %3 %4 %5 %6 %7 %8 %9

%winbootdir%\system32\cmd.exe /k %2 %3 %4 %5 %6 %7 %8 %9

%windir%\system32\cmd.exe /k %2 %3 %4 %5 %6 %7 %8 %9
This one above fails because for some bizarre reason %windir% is empty.

%comspec% /k %2 %3 %4 %5 %6 %7 %8 %9
This one above is a poor choice because it will use command.com instead of cmd.exe and for example "set t" and "exit" both work differently to how they work in cmd.exe.


I settled on this one below - but there is another problem waiting in the wings...
%winbootdir%\system32\cmd.exe /k %2 %3 %4 %5 %6 %7 %8 %9

What would you expect to see on the screen if you use this command with shift enter (assuming the noclose2.bat)?

set|find "32"

For some strange reason the pipe and everything after it gets stripped, which does not happen when using %comspec% alone in the PIF file.


Disclaimer: In my experience XP sometimes gives random faults when using cmd, after certain error handlers have been used, so the above effects may differ. :)


While I don't think TC should abandon Win9x/ME users, IMO the main target audience of TC in the future will be using some version of NT. In my view the main sticking point is the inability to effectively use cmd /k with shift-enter.
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

Is this official?
I hope it will be one day... It was just a proposal to Hacker's statement. Problem is, noone knows what ghisler thinks because he answers not very often... ;)
%winbootdir%\system32\cmd.exe /k %2 %3 %4 %5 %6 %7 %8 %9
Doesn't work on my XP system, variable is not defined.
%windir%\system32\cmd.exe /k %2 %3 %4 %5 %6 %7 %8 %9
Reason why it won't work is simple, windir is not defined as a variable in 16-bit command.com. ;) And command.com is started first when using pif-files.

set|find "32" doesn't work, confirmed.
While I don't think TC should abandon Win9x/ME users
As I mentioned above, %comspec% is available under ALL OSes so it works under Windows 9X with no prob.

Icfu
foxidrive
Junior Member
Junior Member
Posts: 90
Joined: 2004-02-28, 11:50 UTC

Post by *foxidrive »

[winbootdir] variable is not defined.
Thanks for that tip, I've nuked it. Google says it's left over from an upgrade.

As for windir under command.com, you're absolutely correct. It was a Win9x thing that I had to unlearn ;)
IGL
Member
Member
Posts: 179
Joined: 2004-02-26, 10:47 UTC
Location: Poland

An attempt to make it all clearer.

Post by *IGL »

The problem gets bigger and bigger.
As we can see, changing TC could bring more problems. So we better find the best solution first and then kindly ask Mr Ghisler to consider implementing our proposal.
Why I was against modification - was explained above. I sign under those changes that I consider important. It does not mean I don't want to see that change in TC because I don't need it, but:

Author has a lot of work and there are many things in TC to develop and improve. If there is something user cannot change by himself or it's something urgent and important we can insist on author to change it. But if we will flood him with thousands of requests then he will not keep up and probably stop reading forum (he will have no time :) ).
It is the only reason why some people are "against".

I suggest that currently we can create noclose.bat and modify it the way we want - wheather we use %comspec%, command.com, cmd /k or cmd /c etc. - it can be modified by your own depending on what you want.
Adding such bat file is not a big problem - you can keep a copy of that in TC installation folder.

What I could suggest if TC was changed in this matter is:
In configuration let there be an option that you add what string should be added after pressing shift+Enter eg. to run noclose.pif or to add cmd /k or cmd /c or %comspec% or anything.
(& Maybe similiar option if you just type command and press enter)

Would this satisfy us? I would be content.
:-)
icfu
Power Member
Power Member
Posts: 6052
Joined: 2003-09-10, 18:33 UTC

Post by *icfu »

The problem gets bigger and bigger.
As we can see, changing TC could bring more problems.
On the contrary, the problems discussed here are the PRESENT problems because of needed workarounds to let TC work like expected. A change would solve those probs...
So we better find the best solution first and then kindly ask Mr Ghisler to consider implementing our proposal.
Asking ghisler is not needed, he reads everything and decides what he thinks is best anyway. If he is unsure he will ask us. ;)
As he chooses to ignore the noclose.pif matter for years now I really don't expect a solution too soon anyway...
In configuration let there be an option that you add what string should be added after pressing shift+Enter eg. to run noclose.pif or to add cmd /k or cmd /c or %comspec% or anything.
This is the 32-bit version of TC, noone will ever need noclose.pif option.

%comspec% works on all OSes so the only thing to decide is whether to use /c or /k parameter...

Entering a command and pressing ENTER launches %comspec% /c command.
Entering a command and pressing SHIFT-ENTER launches %comspec% /k command.
Or vice versa via command line switch in wincmd.ini or by adding a checkbox close to the command line.

Seems I am repeating myself, sorry. I will retire from this thread till new ideas arise.

Icfu
User avatar
Black Dog
Power Member
Power Member
Posts: 1024
Joined: 2003-02-05, 22:17 UTC
Location: Odessa
Contact:

Post by *Black Dog »

[face=courier]On 01-03-2004 18:25:56 +0000 norfie wrote:

n> I'm sorry I didn't know it. Do I have to ask him for
n> permission?


Well, be my guest, nice guy :).[/face]
Post Reply