Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!tut.cis.ohio-state.edu!ukma!simon From: simon@ms.uky.edu (Simon Gales) Newsgroups: comp.binaries.ibm.pc.d Subject: Re: BEWARE of changing the command line switch (switchar) Keywords: switchar COMMAND.COM Message-ID: <10434@s.ms.uky.edu> Date: 26 Oct 88 00:41:18 GMT References: <824@kksys.UUCP> <170@ocsmd.OCS.COM> <826@kksys.UUCP> Reply-To: simon@ms.uky.edu (Simon Gales) Distribution: na Organization: U of Kentucky, Mathematical Sciences Lines: 31 The reason programs have problems with altered switch characters is not really complicated. When an internal DOS command is invoked from within the program (like 'dir'), the program spawns off a copy of command.com and makes it perform the command ('dir'). In MS C: system("command.com /c dir"); This is supposed to run a command.com and make it do a dir. The normal switchar is '/' so the programmer naturally used '/' to access the '/c' option of command.com. When the above 'system(" ... ")' is done with the switch char changed, command.com does not understand the '/c' anymore, so it returns an error instead of performing the command. The same happens in many other languages, since the string passed to DOS ("command.com /c dir") is usually just typed in directly; rather than going to the trouble of finding out the current switch character and building the string correctly. It may be possible to edit the .exe/.com file, find these strings and change the '/' to a '-' or whatever. I've never tried this, but Norton utilities would probably make it easy. -- <--------------------------------------------------------------------------> <--- Simon Gales@University of Ky 254-9387/257-3597 ---> <--- [ simon@ms.uky.edu ] | [ simon@UKMA.BITNET ] ---> <-------------------------------------------------------------------------->