Path: utzoo!attcan!lsuc!ncrcan!ziebmef!mdfreed From: mdfreed@ziebmef.uucp (Mark Freedman) Newsgroups: comp.sys.ibm.pc Subject: Re: How to change DOS "\" to "/" Keywords: DOS path separator Message-ID: <1989Feb4.105803.26039@ziebmef.uucp> Date: 4 Feb 89 15:58:01 GMT References: <5927@phoenix.Princeton.EDU> Reply-To: mdfreed@ziebmef.UUCP (Mark Freedman) Organization: Ziebmef Public Access Unix, Toronto, Ontario Lines: 79 In article <5927@phoenix.Princeton.EDU> mrwittma@phoenix.Princeton.EDU (Martin R. Wittmann) writes: >I read one can change the DOS path separator, "\", to "/", allowing >(easier typing and) "-" to be used for DOS command options, but I didn't >read how. Could someone please email me the standard response? > >Thanks, martin wittmann (there were several requests, including one to post rather than E-mail) I believe that you want the undocumented MS-DOS "switch char" function. Changing this CAN cause problems, as many DOS commands simply become confused (e.g. format a: -v doesn't work, while DIR c:/dos -w produces a wide listing of the subdirectory). BRAVO Microsoft !!! :-) /* ============== SW_CHAR.C =========================== */ /* tested with PC-DOS 3.2, Turbo C 2.0 */ /** Change MS-DOS Switch char via int 0x21 function 0x37 ***/ /* usage: sw_char x (x is the new switch char) */ /* */ /* N.B. 0x37 is "undocumented" and may cause problems */ /* some DOS commands won't work with the new switch */ /* DIR seems to (e.g. DIR c:/dos -w works) */ #include "dos.h" #include "stdio.h" void print_usage(); void main (int argc, char *argv[]) { char old_switch, *new_switch; if (argc == 2) { new_switch = argv[1]; if (strlen (new_switch) != 1) { print_usage(); return; } } else { print_usage(); return; } /* al = 0 (get switch char); switch char returned in dl */ bdos(0x37, 0, 0); old_switch = (char) _DL; fputs ("\nold switch char is ", stderr); fputc (old_switch, stderr); /* al = 1 (set switch char); dl contains new character */ bdos (0x37, *new_switch, 1); /* al = 0 (get switch char); switch char returned in dl */ bdos(0x37, 0, 0); old_switch = (char) _DL; fputs ("\nnew switch char is ", stderr); fputc (old_switch, stderr); fputs ("\n", stderr); } void print_usage() { fputs ("\nUsage: sw_char x", stderr); fputs ("\n where x is the new switch character", stderr); fputs ("\n", stderr); return; }