[comp.os.msdos.programmer] Changing option character from / to

rwallace@vax1.tcd.ie (09/21/90)

Does anyone know how to change the MS-DOS option character from / to something
else? What I want to do is to change it from / to -, so you can type DIR -W
instead of DIR /W. This will free the / character for use as a directory name
separator so you can type DIR DIRNAME/FILENAME instead of DIR DIRNAME\FILENAME
(the MS-DOS routines will accept / as well as \ but COMMAND.COM won't).

The Turbo C++ manual says it's an INT 21h call, but doesn't say which one. I
can't find it documented anywhere.

Thanks in advance.
-- 
"To summarize the summary of the summary: people are a problem"
Russell Wallace, Trinity College, Dublin
rwallace@vax1.tcd.ie

ts@uwasa.fi (Timo Salmi LASK) (09/21/90)

In article <6867.26f929ec@vax1.tcd.ie> rwallace@vax1.tcd.ie writes:
>Does anyone know how to change the MS-DOS option character from / to something
>else? What I want to do is to change it from / to -, so you can type DIR -W
>instead of DIR /W. This will free the / character for use as a directory name
>separator so you can type DIR DIRNAME/FILENAME instead of DIR DIRNAME\FILENAME
>(the MS-DOS routines will accept / as well as \ but COMMAND.COM won't).
>

TSUTLD18.ARC    Fourth set of Utilities, T.Salmi
Filename        Comment                             Date      Time    CRC
--------        --------------------------------    ----      ----    ---
ADJCURS.BAT     Batch shell for adjusting cursor  09-07-90  10:20:22  777B
BIGCURS.EXE     Make the cursor better visible    12-05-89  14:45:36  48D3
BIGNCURS.EXE    NonResident temporary big cursor  11-29-89  16:17:26  E7CA
CAPS.EXE        Get/set keyboard toggles          07-19-90  14:22:44  BD6B
FILES.EXE       Summary of your different files   09-08-90  13:07:08  2660
KEYRATE.EXE     Set keyboard repeat rate & delay  07-21-90  21:59:44  6DFD
POPSCR.EXE      Pop screen from image file        09-09-90  11:44:56  BF17
PSK.EXE         Dis/enable the PrintScreen key    06-16-90  08:47:50  B029
PUSHSCR.EXE     Push screen to image file         09-09-90  11:44:52  04B8
SETPRT.EXE      Set PrintScreen retry times       07-10-90  12:07:20  4740
--> SWITCHAR.EXE  Makes Unix freaks feel at home    11-26-89  21:25:32  DB26
TODAY.EXE       Scan disk for files made today    07-19-90  15:07:40  B345
TSPROG.INF      List of PD programs from T.Salmi  04-03-90  17:37:40  38AB
TSUTLD.INF      Document                          09-09-90  11:46:34  5A32
TSUTLD.NWS      News announcements about tsutld   09-09-90  11:10:48  1A05
VAASA.INF       Info: Finland, Vaasa, U of Vaasa  02-02-90  11:52:54  F6C0
WARMBOOT.EXE    Reboot without memory tests       09-08-90  15:28:40  ECDD
----            ------             ------  -----
0017            136268             100933   26%

/pc/ts/tsutld18.arc is available by anonymous ftp from
chyde.uwasa.fi, Vaasa, Finland.

...................................................................
Prof. Timo Salmi        (Moderating at anon. ftp site 128.214.12.3)
School of Business Studies, University of Vaasa, SF-65101, Finland
Internet: ts@chyde.uwasa.fi Funet: gado::salmi Bitnet: salmi@finfun

stever@Octopus.COM (Steve Resnick ) (09/22/90)

In article <6867.26f929ec@vax1.tcd.ie> rwallace@vax1.tcd.ie writes:
>Does anyone know how to change the MS-DOS option character from / to something
>else? What I want to do is to change it from / to -, so you can type DIR -W
>instead of DIR /W. This will free the / character for use as a directory name
>separator so you can type DIR DIRNAME/FILENAME instead of DIR DIRNAME\FILENAME
>(the MS-DOS routines will accept / as well as \ but COMMAND.COM won't).
>
>The Turbo C++ manual says it's an INT 21h call, but doesn't say which one. I
>can't find it documented anywhere.
>
This is done through UNDOCUMENTED DOS Function 37H This works like this:

	AH=37H
	AL=0	- Querey Current Switch Character
	AL=1	- Set Current Switch Character in DL
	Returns:
	DL	- Current Switch Character

	To Set the char to '-' in assembler (you can do this from Debug too)
	use:

	MOV	AX,3701H
	MOV	DL,2DH
	INT	21H
	RET

Hope this helps....
Steve


-- 
----------------------------------------------------------------------------
steve.resnick@f105.n143.z1@FIDONET.ORG #include<std_disclaimer.h>
Flames, grammar errors, spelling errrors >/dev/nul
----------------------------------------------------------------------------

Ralf.Brown@B.GP.CS.CMU.EDU (09/22/90)

In article <1990Sep21.190505.1542@Octopus.COM>, stever@Octopus.COM (Steve Resnick ) wrote:
}In article <6867.26f929ec@vax1.tcd.ie> rwallace@vax1.tcd.ie writes:
}>Does anyone know how to change the MS-DOS option character from / to something
}>else? What I want to do is to change it from / to -, so you can type DIR -W
}>
}>The Turbo C++ manual says it's an INT 21h call, but doesn't say which one. I
}>can't find it documented anywhere.
}>
}This is done through UNDOCUMENTED DOS Function 37H This works like this:
}[...omitted...]

Turbo C 1.5/2.0 and Turbo C++ 1.0 have undocumented library functions
      int getswitchar(void) ;
and
      void setswitchar(char c) ;
which make the undocumented DOS call.  TC1.0 may have had them, but I can't
recall.
--
UUCP: {ucbvax,harvard}!cs.cmu.edu!ralf -=- 412-268-3053 (school) -=- FAX: ask
ARPA: ralf@cs.cmu.edu  BIT: ralf%cs.cmu.edu@CMUCCVMA  FIDO: 1:129/3.1
Disclaimer?    |   I was gratified to be able to answer promptly, and I did.
What's that?   |   I said I didn't know.  --Mark Twain

browns@iccgcc.decnet.ab.com (Stan Brown, Oak Road Systems) (09/27/90)

In article <26fb50c3@ralf>, Ralf.Brown@B.GP.CS.CMU.EDU writes:
> In article <1990Sep21.190505.1542@Octopus.COM>, stever@Octopus.COM (Steve Resnick ) wrote:
> }In article <6867.26f929ec@vax1.tcd.ie> rwallace@vax1.tcd.ie writes:
> }>Does anyone know how to change the MS-DOS option character from / to something
> }>else? What I want to do is to change it from / to -, so you can type DIR -W
> }>
> }>The Turbo C++ manual says it's an INT 21h call, but doesn't say which one. I
> }>can't find it documented anywhere.
> }>
> }This is done through UNDOCUMENTED DOS Function 37H This works like this:
> }[...omitted...]
> 
> Turbo C 1.5/2.0 and Turbo C++ 1.0 have undocumented library functions
>       int getswitchar(void) ;
> and
>       void setswitchar(char c) ;
> which make the undocumented DOS call.  TC1.0 may have had them, but I can't
> recall.

However, many (most) programs won't recognize the change.  See FAQ in
(if memory serves) comp.sources.ibm.pc.  This is not due to any error
in int 21 func 37, or in the Turbo functions; rather to the faact that
many (most) programs don't read the switch char.

Stan Brown, Oak Road Systems, Cleveland, Ohio, U.S.A.      (216) 371-0043
 email: browns@iccgcc.decnet.ab.com
Disclaimer:   Your mileage may vary.  Close cover before striking.   Void
where taxed, regulated, licensed, or prohibited by law. I am not a crook.