Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version nyu B notes v1.5 12/10/84; site csd2.UUCP Path: utzoo!watmath!clyde!burl!ulysses!gamma!epsilon!zeta!sabre!petrus!bellcore!decvax!decwrl!pyramid!ut-sally!seismo!cmcl2!csd2!jacobsn From: jacobsn@csd2.UUCP (Nicholas H. Jacobs) Newsgroups: net.micro.pc Subject: Undocumented MS-DOS call for getting the switch char Message-ID: <3340005@csd2.UUCP> Date: Thu, 2-Jan-86 18:26:00 EST Article-I.D.: csd2.3340005 Posted: Thu Jan 2 18:26:00 1986 Date-Received: Sat, 4-Jan-86 05:40:34 EST Organization: New York University Lines: 23 Many of you may have seen the short note in Dr. Dobb's a while back that allows you to change the switch character in MS-DOS from a '/' to '-', the latter character being the standard switch character in UNIX. This is achieved by putting the line "SWITCHAR=-" in your config.sys file. However, not every compiler on the market knows how to look for this character and when exec'ing command.com to perform the system() function it may die (most notably Lattice does this...). This is because the call to the exec'ing routine simply places a '/c' to the beginning of your command and has command.com exec it. This can be fixed though by re-writing the system() function (a fairly simple function) with the check as follows. There is an undocumented call to DOS which uses interrrupt 21h with (AH) = 37h. Upon return from this call (DL) will contain the ASCII value of the current switch character in it. NOTE: I have heard that changing the switch character does not work under MS-DOS 3.0+, so for many of you this may be less than useful. Hope this is useful to application writers working under DOS. Nicholas Jacobs cmcl2!csd2!jacobsn