Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uwm.edu!zaphod.mps.ohio-state.edu!samsung!umich!ox.com!mudos!mju From: mju@mudos.ann-arbor.mi.us (Marc Unangst) Newsgroups: comp.os.msdos.programmer Subject: Re: MS-DOS EXEC Question Message-ID: Date: 8 Sep 90 23:41:13 GMT References: <1990Sep7.144359.25202@jarvis.csri.toronto.edu> Organization: The Programmers' Pit Stop, Ann Arbor MI Lines: 27 west@turing.toronto.edu (Tom West) writes: > Does anyone know what the behaviour of the EXEC MS-DOS function is when > there is not enough memory to load COMMAND.COM. > > Specifically, I have a line that is: > > retcode = spawnve(P_WAIT, "C:\COMMAND.COM", path, environ); [computer locks up when there isn't enough mem to load COMMAND.COM] This isn't going to help you much, but I've encountered this in Zenith's MS-DOS v3.21 also. Your best bet might be to check to see if there's at least 50K left, and refuse to spawn the command processor if there isn't. Also, PLEASE don't hardcode "C:\COMMAND.COM" into your program. Not only does it prevent people who don't have a hard disk from using your program (if you think they're rare, what about people with diskless workstations or computers with a floppy only, who run stuff off the network?), but it prevents people from using an alternate command processor, such as 4DOS, with your program. I'd suggest that you grab COMSPEC from the environment and try to load that, and only try to explicitly spawn COMMAND.COM if COMSPEC doesn't exist. -- Marc Unangst | mju@mudos.ann-arbor.mi.us | Angular momentum makes the world go 'round. ...!umich!leebai!mudos!mju |