[comp.sys.ibm.pc] Changing AUTOEXEC.BAT path

mrk@gvgspd.GVG.TEK.COM (Michael R. Kesti) (06/19/88)

In article <1988Jun17.110045.27448@gpu.utcs.toronto.edu> ansari@gpu.utcs.UUCP (Aali Ansari) writes:
>
>	is there a way to give the path to autoexec.bat  instead of keeping
>	in root ?

I have used the following quick and dirty method to change the path to both
AUTOEXEC.BAT and CONFIG.SYS for some time with no problems.

The method involves patching the files in which these files are specified
using a binary editor such as debug, symdeb, the Norton utility, or whatever.

For example, CONFIG.SYS is specified in IBMBIO.COM.  I started by searching
for the string CONFIG.SYS.  I found two occasions of this string.  The first
was obviously the file spec, which I changed to SYS/CONFIG.  Note that the
number of characters in the replacement string must be the same as in the
replaced string.  Now my system expects to find the information that is
normally in CONFIG.SYS in SYS\CONFIG instead.  The other occasion was part
of an error message, that I similiarly changed, so that the error would be
properly reported.

AUTEOEXEC.BAT is specified in COMMAND.COM.  In this case, I found just one
occasion of the string AUTOEXEC.BAT and changed it to SYS\AUTOEXEC, so now
my system uses SYS\AUTOEXEC for its startup script.

Note that this technique is useful in other ways as well.  Suppose you wish to
replace a built in command in COMMAND.COM, such as DIR.  You would search
COMMAND.COM for the string DIR, and replace it with something else, perhaps
FOO.  Now when the user enters the command DIR, COMMAND.COM will find that
it is NOT a built in command, and perform its search for an external
executable.

Here's another example.  I found that Sidekick couldn't find its help file
unless it was in the current directory.  I changed all occurances of SK.HLP
in SK.COM (I found three) to \SYS\S and renamed \SYS\SK.HLP to \SYS\S.  Now
Sidekick will find its help file no matter what the current directory is.

DISCLAIMER:  If you don't know how to use a binary editor, or proper
backup techniques so that you can recover if you screw things up, then I
don't recommend you try this.  In any event, I won't be responsible for
anything that happens!

Happy hacking!

-- 
============================================================================
Michael Kesti  Grass Valley Group, Inc. | "Like one and one don't make two,
    @gvgspd.GVG.TEK.COM                 |  one and one make one."
    !tektronix!gvgpsa!gvgspd!mrk        |         - The Who, Bargain