Feature request: update for Shift Enter

English support forum

Moderators: white, Hacker, petermad, Stefan2

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

Feature request: update for Shift Enter

Post by *foxidrive »

Greetings.

I use NT and in a default TC install shift-enter uses nopause.pif to pause the console window so it can be read.

While this works I would like to suggest that TC launch a batch file (NOPAUSE.BAT perhaps) which can be modified and customised for any Windows OS. In fact, nopause.pif could still be used to control the behavior of nopause.bat in the standard windows way.

This would allow NT users to use cmd.exe /c and Windows 9x/ME users can still use command.com /c and either camp can configure the behavior of shift enter to their hearts content.

For example, I like to use cmd /k instead of cmd /c which leaves the console window active after the command has executed, and then I use exit (in another e.bat) to close the dos window when I have finished with it.


I would like to suggest the following batch file for NOPAUSE.BAT
Comments appreciated.

@echo off
if [%1]==[] goto :end
set tccl=NT&
if not "%tccl%"=="NT" goto :PreNT
:: Windows NT/W2K/XP etc commands go here
"%windir%\system32\cmd.exe" /c %*
pause>nul
set tccl=
goto :EOF

:PreNT
:: Windows 9X/ME commands go here
"%windir%\command.com" /c %1 %2 %3 %4 %5 %6 %7 %8 %9
pause>nul
set tccl=
:end
User avatar
norfie
Power Member
Power Member
Posts: 1194
Joined: 2003-02-18, 14:18 UTC

Post by *norfie »

Last edited by norfie on 2004-09-11, 07:25 UTC, edited 1 time in total.
foxidrive
Junior Member
Junior Member
Posts: 90
Joined: 2004-02-28, 11:50 UTC

Post by *foxidrive »

The cmd line in the pif file doesn't honour any switches or arguments.
For example this will not leave the cmd window open

%comspec% /k

and this doesn't launch the batch file

%comspec% /c "%windir%\NoClose2.bat"
User avatar
norfie
Power Member
Power Member
Posts: 1194
Joined: 2003-02-18, 14:18 UTC

Post by *norfie »

Last edited by norfie on 2004-09-11, 07:37 UTC, edited 1 time in total.
foxidrive
Junior Member
Junior Member
Posts: 90
Joined: 2004-02-28, 11:50 UTC

Post by *foxidrive »

I actually do have this there atm:

%windir%\NoClose2.bat

but there is another issue I didn't mention.

If you use the pif file and create %windir%\NoClose2.bat with this inside it
@echo off
echo "%0"-"%1"-"%2"-"%3"-"%4"

then launch
SET T
using shift enter

You will find that %1 is always set to /C such as this output shows.

"NOCLOSE2"-"/C"-"set"-"t"-""

While this isn't fatal, getting around it is sloppy.
I have a workable solution so I am not fussed if nothing changes - though I had thought launching a pif file would start a 16 bit process to handle the pif file, instead of a 32 bit process from the word go. But I am not certain of that...
User avatar
norfie
Power Member
Power Member
Posts: 1194
Joined: 2003-02-18, 14:18 UTC

Post by *norfie »

Last edited by norfie on 2004-09-11, 07:30 UTC, edited 1 time in total.
foxidrive
Junior Member
Junior Member
Posts: 90
Joined: 2004-02-28, 11:50 UTC

Post by *foxidrive »

/C is necessary: command /C .
I can understand why you believe that, but test it for yourself. Copy and rename noclose.pif, make a batch file, and you will see that /C is not passed to the batch file.

It is evident that /C is being passed to the NOCLOSE.PIF file by TC, regardless of what command is being used in the PIF cmd line - either %comspec% or batch file.
Post Reply