Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!linus!philabs!cmcl2!acf8!movshon From: movshon@acf8.UUCP (Tony Movshon) Newsgroups: net.micro.pc Subject: Re: Help with SWITCHAR Message-ID: <10500002@acf8.UUCP> Date: Sat, 22-Feb-86 18:13:00 EST Article-I.D.: acf8.10500002 Posted: Sat Feb 22 18:13:00 1986 Date-Received: Mon, 24-Feb-86 06:48:55 EST References: <2000@psuvax1.UUCP> Organization: New York University Lines: 44 The following problem is one that I have grappled with for a while, but have now solved. > ... when I add the line: > switchar=- > to my config.sys file, trying to enter the editor from more causes > the error: > Specified COMMAND search directory bad > Does anybody know what the problem might be? > > Fred Hollander > Penn State The problem is this: when a DOS program executes a sub-process via the command interpreter, it uses the system LOADEXEC function with an argu- ment string like "command /c commandname" The "/c" switch tells the exec'ed version of command to run the process and then exit. If you are hooked on using the Un*x-like "-" as a switch character, the command processor interprets the "/c" not as a switch but as an argument, and complains. The solution is to use the DEBUG program to find all instances of "command /c" (or "COMMAND /C", or whatever case combo the programmer may have liked) and replace the "/" with "-". Note that after you do this, the resulting program will not run unless the switch character has been redefined. What programs should do, of course, is use the (undocumented) DOS function 37H to determine the current switch character, and compile the command string correctly. This is done by some but not all DOS system programs, and a few applications. Example code to do this (contributed by yours truly) can be found in releases of MS-Kermit V2.27 or later; it is not very complicated. Incidentally, the declaration of SWITCHAR is no longer allowed in DOS 3.x, but you can still use function 37H to set the switch character to your liking. There is a small public-domain program called SWCHAR around which does this; I will repost it if there is enough demand. Tony Movshon Psychology/NYU uucp: {seismo|ihnp4|allegra}!cmcl2!acf8!movshon arpa: movshon@acf8