Path: utzoo!utgpu!watmath!clyde!att!pacbell!ames!mailrus!tut.cis.ohio-state.edu!cs.utexas.edu!milano!bigtex!texbell!killer!jls From: jls@killer.DALLAS.TX.US (Jerome Schneider) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: BEWARE of changing the command line switch (switchar) Summary: Patch to COMMAND.COM fixes problem permanently Keywords: switchar COMMAND.COM Message-ID: <6261@killer.DALLAS.TX.US> Date: 29 Nov 88 08:26:32 GMT References: <824@kksys.UUCP> <170@ocsmd.OCS.COM> <826@kksys.UUCP> <10629@s.ms.uky.edu> Distribution: na Organization: The Unix(R) Connection, Dallas, Texas Lines: 29 In article <10629@s.ms.uky.edu>, simon@ms.uky.edu (Simon Gales) writes: > In article <826@kksys.UUCP> bird@kksys.UUCP (Mike Bird) writes: > >In article <170@ocsmd.OCS.COM>, bell@ocsmd.OCS.COM (John T. Bell) writes: > ....... > > In MS C, this can be done by: > system("command.com /c progname"); > > Note that a '/c' is used, without checking to see if '/' is actually the > switch character. This can be changed to '-c' if you have access to the > application's source (I have pibterm's if you want it). This is done > slightly differently in TP, but I believe that it's similar. > I posted a message with a patch to command.com for permanently setting either the / or - as valid switch chars within command.com. Thus, when any program uses the system() call, the /c works even if switchar is -. The patch was in a message detailing several MKS ppatches (but was very long - 400 lines). I could post a quick summary or email you the patch if you wish. The "Specified COMMAND search path bad" error results because command.com doesn't see the -c as an option flag, and thus treats it like a new path to cofigure the COMSPEC variable. Because a file /c is not found, the COMSPEC is not altered, but the error is posted and an empty environment is generated. This probably was an error in design, since the path should only be examined by a login (or root) command.com (using the /p, for example, but has been a bug since the begining. Heck, don't use them undocumented bugs, anyway! :-).