• Please review our updated Terms and Rules here
  • Exhibitor application for VCF West 2022 is now open! If you are interested in exhibiting, please fill out the form here.

Point COMSPEC to arbitrary DOS program

cr1901

Veteran Member
Joined
Dec 28, 2011
Messages
817
Location
NJ
In the UNIX world (at least the System V world), one can change the default start program from init by specifying certain kernel command line arguments (often from GRUB or another interactive bootloader).

Is it possible to do the same thing for DOS using COMSPEC, such that instead of spawning a shell at boot, it just runs the program. I feel this could be useful for certain emergency booter floppies where you need DOS I/O but don't necessarily want the command interpeter.

The one I have in mind is for backup and restore purposes, where the program asks you to reboot/remove floppy when you're done. Not requiring the command interpreter frees memory and prevents the user from trying to remove AUTOEXEC.BAT and CONFIG.SYS on the floppy or doing other fun things to screw up the program. Of course, one could just write protect the floppy too :p.

In all seriousness, this is just a curiosity more than anything. Also, if said program terminates and there is no command interpreter to return to, what happens? Does the program spawn itself again, like COMMAND.COM will?
 

reenigne

Veteran Member
Joined
Dec 13, 2008
Messages
702
Location
Cornwall, UK
I remember doing this with DOS 3.2 to fit as many games as possible onto two 360kB disks with a small menu program to choose which game to run. I just renamed my menu/shell program as COMMAND.COM. I don't think there's a way to do the equivalent of setting COMSPEC from CONFIG.SYS so the shell has to have that name.
 
Top