djb@wjh12.harvard.edu (David J. Birnbaum) (08/30/89)
There has been some debate (and exchange of 'ahems') about whether 'shell=d:\dos\command.com d:\dos\command.com /p' (or something similar) is kosher. The debate centers around the second parameter, which can be used to set comspec. This is not documented in my MS-DOS 3.3 manual (document #410630013- 330-R04-0787). Apparently it is documented in some distributions of MS-DOS and not in others. Although it may work, there are two good reasons to avoid it. First, it isn't necessary, at least for 3.3. You can reset comspec to whatever you want by specifying 'set comspec=d:\dos\command.com' in your autoexec.bat file (or anywhere else). The initial command processor will be loaded as specified in the shell command, but any subsequent loading will look at comspec (at least for well-behaved programs). Those who don't like the limitations of command.com may wish to look at 4dos (J.P. Software, P.O. Box 1470, E. Arlington, MA 02174; 617-646-3975); it is a replacement for command.com that does not use the second shell parameter under discussion. Second, if you use any tsrs you probably set environment variables in your autoexec.bat file only after loading tsrs; you also probably set your path only after loading tsrs. Since some tsrs use memory to store a copy of the environment (that they don't really need), you can keep the environ- ment small and use less memory by loading tsrs first. You can squeeze a little more memory out of your system by setting comspec to null at the beginning of your autoexec.bat file ('set comspec='), loading your tsrs, and then resetting comspec when you set up your path and other environment variables. In this case, you would just be erasing the effects of the second shell parameter. Summary: at least for 3.3, you can set comspec explicitly in your autoexec.bat file and not concern yourself with whether a second shell parameter is documented (or available) in your version of DOS. As a bonus, you can also set comspec to null before loading tsrs and save a little memory. But remember to reset comspec afterwards! --David ==================================================================== David J. Birnbaum djb@wjh12.harvard.edu [Internet] 11 Adams Terrace djb@harvunxw.bitnet [Bitnet] Cambridge, MA 02138 USA ====================================================================