The replacer for the file noclose.pif that is used by the file manager Total Commander for starting console applications without closing the console window.
Author of the program: Konstantin Vlasov, 2006 Homepage: http://flint-inc.ru/ E-mail: support@flint-inc.ru
Usually when starting a console or DOS application from Total Commander, a console window appears that contain the program started, and after the program is finished this windows is closed. This is very inconvenient if it is necessary to view the text that the program printed. That's why Total Commander allows to start console applications without closing the console window. To do so the user should start the program by pressing Shift+Enter hotkey instead of the usual Enter.
On such way of starting the application, Total Commander executes the following command line:
noclose.pif /C <parameters>
where <parameters> is the application that you started (including its own command-line parameters if any). The standard file noclose.pif is installed into the Windows folder on installing Total Commander. This file is customized so that it runs the command interpreter command.com and do not close the console window after this program is finished. So, the user can read all that the program he started printed onto the screen, and then close the console window manually.
There are however some drawbacks of this approach:
The program NoClose Replacer was designed to fix all these disadvantages and to add some additional possibilies and conveniences.
Just copy the files NoClose.ini and NoClose.pif from the archive into your Windows directory. Then write into the NoClose.ini file the correct settings and... that's all, enjoy it! :-) By default, if there are no settings specified, the program uses the command interpreter command.com with the parameter /K in the systems based on the Win9x kernel (Windows 95/98/ME), and cmd.exe with the parameter /K in the systems based on the WinNT kernel (Windows NT/2000/XP/2003; possibly, Windows Vista - the program was not tested in this OS). If you prefer some alternative command processors, you should specify them in the settings file NoClose.ini (see the settings description below).
Section [General]
CommandProcessor
The program that is used as the shell for running the console application. By default the program uses the command linewhen working in WinNT and
cmd.exe /K when working in Win9x. In the command line you may use the expression %1 which will be replaced with the full list of the parameters including the program name. If %1 is not present at all, the parameters are just added without changing to the end of the command line specified.
command.com /K
- Example 1
Starting: noclose.pif /C file.exe /param1 /param2
CommandProcessor=cmd.exe /K
Result: cmd.exe /K file.exe /param1 /param2
- Example 2
Starting: noclose.pif /C file.exe /param1 /param2
CommandProcessor="C:\Program Files\4DOS\4DOS.COM"
Result: "C:\Program Files\4DOS\4DOS.COM" file.exe /param1 /param2
- Example 3
Starting: noclose.pif /C file.exe /param1 /param2
CommandProcessor=shell.exe "%1" /wait
Result: shell.exe "file.exe /param1 /param2" /wait
CommandProcessorNT
CommandProcessor9x
These two parameters allows to specify different command interpreters for the Windows systems based on the NT and 9x kernels, and have the higher priority than the CommandProcessor parameter.
ShowWindow
This parameter specifies how the console window will look after starting the program. Possible values:By default the mode normal is used.
normal - the window is opened as usual, in normal mode. minimize - after creation the window is minimized. maximize - after creation the window is maximized. hide - the window will be hidden. This mode is not recommended, because in this case you will not be able to terminate the application correctly by yourself!
ShortcutWaitDelay
Time (in milliseconds) for waiting of pressing an additional hotkey. If this parameter is not zero, the program after starting does not start the command interpreter, but waits for the time specified. If the user during this time presses some hotkey that is present in the [ShortcutsNN] section (see below), then the program specified for this hotkey will be started. If no hotkey was pressed or the hotkey is absent in the settings, the default command interpreter will be started, the one that is specified in the CommandProcessorNN parameters.
Section [Shortcuts]
In this section specific hotkeys can be assigned for starting alternative programs instead of ones specified in the CommandProcessorNN parameters. The format is the following:Possible values for modifiers:
<Modifiers>+<Key>=<Command> Please note: In Windows 95/98/ME left and fight Shift, Ctrl and Alt keys are not distinguished by the system, so the program also cannot distinguish them!
L - left key R - right key C - Ctrl A - Alt S - Shift W - Win M - ContextMenu
Examples:The main key is separated from the modifiers by the symbol '+' (plus). If there are no modifiers the '+' sign must be present anyway. If the main key is absent, the plus sign must not be written. Examples:
LW - LeftWin (Left Win key) CRA - Ctrl + RightAlt (any Ctrl key + right Alt key) LSRS - LeftShift + RightShift (simultaneous pressing of left and right Shift keys) The full list of the notations for all keys:
C+A - Ctrl + A AS+F9 - Alt + Shift + F9 LSW - LeftShift + Win (without the main key) +PRNSCR - PrintScreen (without the modifiers) A - Alt +A - A (that's why the plus sign is needed) Examples of command records:![]()
[Shortcuts] CS=cmd.exe /C LAS+TAB=4nt.com "%1" +SCROLLLOCK=C:\run.bat
Section [ShortcutsNT]
Section [Shortcuts9x]
These sections are analogous to the [Shortcuts] section described above, but specific for the Windows systems based on NT and 9x kernels respectively. The keys from the section [Shortcuts] are taken into account regardless of the OS, i.e. in NT system all keys from the sections [Shortcuts] and [ShortcutsNT] are taken, and in 9x - from [Shortcuts] and [Shortcuts9x]. This allows to combine in one settings file both hotkeys that are the same in every system and ones that depend of the OS kernel.
First, thanks to Aleksey Fomin (Led) who clearly stated the idea of the program and created the first working prototype for it using Delphi. Unfortunately, this IDE creates very large EXE files, so now the program is developed using Visual C++.
Also thanks to Vadim Kazakov who acted as the beta-tester for this program, to Icfu and mozers who suggested and tested very interesting improvements, and to all users who reported about bugs in the program and gave ideas about making the program better.
And of course, I can't but thank Christian Ghisler who created such wonderful tool as Total Commander.