[comp.sys.ibm.pc.misc] Need to change name of AUTOEXEC

chrisb@hubcap.clemson.edu (Chris Behrens) (03/29/91)

Is there a program that will allow me to change the name of the file
that COMMAND.COM looks for when booting ??  By default, it looks for and
executes AUTOEXEC, i want to name it something else, maybe place it in a
subdirectory or something. Simply running a different BAT file from
within the AUTOEXEC is not what I want.

Any help appreciated...

Thank You.
Chris Behrens 
ChrisB@Hubcap.Clemson.Edu

s907396@minyos.xx.rmit.oz.au (Miramar) (03/30/91)

chrisb@hubcap.clemson.edu (Chris Behrens) writes:

>Is there a program that will allow me to change the name of the file
>that COMMAND.COM looks for when booting ??  By default, it looks for and
>executes AUTOEXEC, i want to name it something else, maybe place it in a
>subdirectory or something. Simply running a different BAT file from
>within the AUTOEXEC is not what I want.

You can do that by altering COMMAND.COM itself using a binary editor. I 
used Norton Utilities' NU.EXE to do it. Edit COMMAND.COM and search for the
string 'AUTOEXEC.BAT' and change it to whatever you want. I try to use names
of the same length as 'AUTOEXEC.BAT' so as not to complicate things. Dunno
about placing it in a sub-directo though. This method isn't very dangerous
if you know what you're doing but there's a always the risk of accidentally 
changing a byte somewhere in COMMAND.COM and there might be problems with
programs which looks for AUTOEXEC.BAT.

Eugene...
-- 
-----/ _ _ \--------------------------------------------------------------------
     | o o |    Eugene Mok  s907396@minyos.xx.rmit.oz.au  (Melbourne OZ)
     \  ^  /                 eugene@pogo.ai.mit.edu       (USA)
------\ o /---------------------------------------------------------------------

aa581@cleveland.Freenet.Edu (Sandra Rozhon) (03/30/91)

In a message from (chrisb@hubcap.clemson.edu (Chris Behrens))
 
>Is there a program that will allow me to change the name of the file
>that COMMAND.COM looks for when booting ??  By default, it looks for and
>executes AUTOEXEC, i want to name it something else, maybe place it in a
>subdirectory or something. Simply running a different BAT file from
>within the AUTOEXEC is not what I want.
 

Go ahead and create the .BAT file you want to use in whatever 
subdirectory you wish, then in your AUTOEXEC.BAT have only one line that
refers to that batch file.  

Example:

(contents of your AUTOEXEC.BAT will look like this)
c:\batchfiles\newauto


In \batchfiles you would have your NEWAUTO.BAT that contains all the
things your old AUTOEXEC.BAT had.



Sandra Rozhon (aa581@cleveland.freenet.edu)

nyet@nntp-server.caltech.edu (n liu) (03/30/91)

aa581@cleveland.Freenet.Edu (Sandra Rozhon) writes:


>In a message from (chrisb@hubcap.clemson.edu (Chris Behrens))
> 
>>Is there a program that will allow me to change the name of the file
>>that COMMAND.COM looks for when booting ??  By default, it looks for and
>>executes AUTOEXEC, i want to name it something else, maybe place it in a
>>subdirectory or something. Simply running a different BAT file from
>>within the AUTOEXEC is not what I want.
> 

>Go ahead and create the .BAT file you want to use in whatever 
>subdirectory you wish, then in your AUTOEXEC.BAT have only one line that
>refers to that batch file.  

Wait, thats not right... Lets try that again:

>>... Simply running a different BAT file from
>>within the AUTOEXEC is not what I want.

What you might want to try is to sector edit your command.com with nu 
(Norton Utils).. Search for autoexec.bat and replace it with whatever you
want.. I'm pretty sure this works (at least it did MANY years ago for
me with dos 2.11). You really want to have both a backup copy of 
the original command.com and a BOOT DISK! If i'm wrong you could be
in for serious problems booting off the drive.
Actually, i'd try it on a floppy first anyways.
No guarantees - maybe you've tried this already and bad things happened..

nye

) (03/31/91)

In article <1991Mar28.190057.3441@hubcap.clemson.edu> chrisb@hubcap.clemson.edu (Chris Behrens) writes:
>Is there a program that will allow me to change the name of the file
>that COMMAND.COM looks for when booting ??  By default, it looks for and
>executes AUTOEXEC, i want to name it something else, maybe place it in a
>subdirectory or something. Simply running a different BAT file from
>within the AUTOEXEC is not what I want.
>


Chris,
  I know this probably doesn't help much, but DEBUG.COM is what you could
use.  I don't know the address's for the changes but about six months back
PCMagazine had a little sidebar on the subject (They were suggesting this to
protect your AUTOEXEC.BAT from ill-tempered install programs.  PC-Magnet is
probably the best place to search for the issue and volume #..



---

  Steve Bibbo                       UUCP : bibbo@moncol.UUCP (The Monk!)
  Computer Operations               Internet: moncol!bibbo@princeton.edu
  Monmouth College                  CompuServe: 72657,602
  W Long Branch, NJ 07764           Voice: (908) 571-3559
    

amichiel@rodan.acs.syr.edu (Allen J Michielsen) (03/31/91)

In article <1991Mar29.163548.29870@minyos.xx.rmit.oz.au> s907396@minyos.xx.rmit.oz.au (Miramar) writes:
>chrisb@hubcap.clemson.edu (Chris Behrens) writes:
>>that COMMAND.COM looks for when booting ??  By default, it looks for and
>>executes AUTOEXEC, i want to name it something else, maybe place it in a
>>subdirectory or something. 
>
>You can do that by altering COMMAND.COM itself using a binary editor. I 
>used Norton Utilities' NU.EXE to do it. Edit COMMAND.COM and search for the
>string 'AUTOEXEC.BAT' and change it to whatever you want. I try to use names
>of the same length as 'AUTOEXEC.BAT' so as not to complicate things.

   This is exactlt right.  You can put it anywhere and call it anything, but
probably NOBODY should try changing the length of the string used. so: command.
com has the string  autoexec.bat in it, so if you use something like
\hide\at.bat this will work just fine....

al


-- 
Al. Michielsen, Mechanical & Aerospace Engineering, Syracuse University
 InterNet: amichiel@rodan.acs.syr.edu  amichiel@sunrise.acs.syr.edu
 Bitnet: AMICHIEL@SUNRISE 

mcnab_pd@darwin.ntu.edu.au (03/31/91)

In article <1991Mar28.190057.3441@hubcap.clemson.edu>, chrisb@hubcap.clemson.edu (Chris Behrens) writes:
> Is there a program that will allow me to change the name of the file
> that COMMAND.COM looks for when booting ??  By default, it looks for and
> executes AUTOEXEC, i want to name it something else, maybe place it in a
> subdirectory or something. Simply running a different BAT file from
> within the AUTOEXEC is not what I want.
> 
> Any help appreciated...
> 

Possibly the easiest thing to do is to edit the COMMAND.COM file itself and
rename "AUTOEXEC.BAT" to (maybe) "BOOTFILE.BAT" (as I did on mine). This is
probably best accomplished with a file editor - but remember that the change in
the file will turn up on any system/virus checking software (well...it should
anyway!!!)

Xcacorp

it1@Isis.MsState.Edu (Tim Tsai) (03/31/91)

>In article <1991Mar28.190057.3441@hubcap.clemson.edu>, chrisb@hubcap.clemson.edu (Chris Behrens) writes:
> Is there a program that will allow me to change the name of the file
> that COMMAND.COM looks for when booting ??  By default, it looks for and
> executes AUTOEXEC, i want to name it something else, maybe place it in a
> subdirectory or something. Simply running a different BAT file from
> within the AUTOEXEC is not what I want.
> 
> Any help appreciated...

  I normally use PC Tools for this purpose.

  I've used "dos\auto.bat" and "dos\cf.sys" for years without any
problem.  I also have COMMAND.COM as "dos\cmd.com" (and COMSPEC is point
to it)..  You can do this by modifying the two hidden system files on your
boot disk (you didn't hear this from me if you screw up your disk in the
process..  :-)  I like being able to type "del *.*" in my root directory
(and no, I don't type that on other people's machine and I don't like
read-only autoexec.bat & config.sys)

  Oh yeah, some dumb programs will insist on looking for C:\command.com
instead of looking at the COMSPEC environment variable..  You can have
a dummy c:\command.com in the root directory to keep these programs happy.

  One side effect:  The floppy disks you format will inherit this
behavior too.
--
  Sometimes I think the surest sign that intelligent life exists elsewhere
  in the universe is that none of it has tried to contact us. <Calvin>

campbell@dev8o.mdcbbs.com (Tim Campbell) (04/01/91)

In article <9103291744.AA27144@cwns1.INS.CWRU.Edu>, aa581@cleveland.Freenet.Edu (Sandra Rozhon) writes:
> 
> In a message from (chrisb@hubcap.clemson.edu (Chris Behrens))
>  
>>Is there a program that will allow me to change the name of the file
>>that COMMAND.COM looks for when booting ??  By default, it looks for and
>>executes AUTOEXEC, i want to name it something else, maybe place it in a
>>subdirectory or something. Simply running a different BAT file from
>>within the AUTOEXEC is not what I want.
>  
> 
> Go ahead and create the .BAT file you want to use in whatever 
> subdirectory you wish, then in your AUTOEXEC.BAT have only one line that
> refers to that batch file.  
> 
> Example:
> 
> (contents of your AUTOEXEC.BAT will look like this)
> c:\batchfiles\newauto
> 
> 
> In \batchfiles you would have your NEWAUTO.BAT that contains all the
> things your old AUTOEXEC.BAT had.
> 
> 
> 
> Sandra Rozhon (aa581@cleveland.freenet.edu)
-- 
Sorry I missed the original - I've done this before.  I beleive that if you
take a hex-editor (debug will work - I used PC-tools) and load the invisible
file (IBMDOS.SYS) you'll notice that the name of the file to execute is 
spelled out (located near the end of the file - AUTOEXEC.BAT) - I simply
renamed this to a different file - say, AUTOBOOT.BAT.
I did this because I didn't want people messing with the file, so I created
it and hid it.

	-Tim

  ---------------------------------------------------------------------------
	  In real life:  Tim Campbell - Electronic Data Systems Corp.
     Usenet:  campbell@dev8.mdcbbs.com   @ McDonnell Douglas M&E - Cypress, CA
       also:  tcampbel@einstein.eds.com  @ EDS - Troy, MI
 CompuServe:  71631,654	 	         Prodigy:  MPTX77A
 P.S.  If anyone asks, just remember, you never saw any of this -- in fact, I 
       wasn't even here.

dale@cec2.wustl.edu (Dale Frye) (04/01/91)

In article <9103291744.AA27144@cwns1.INS.CWRU.Edu> aa581@cleveland.Freenet.Edu writes:
>
>In a message from (chrisb@hubcap.clemson.edu (Chris Behrens))
> 
>>Is there a program that will allow me to change the name of the file
>>that COMMAND.COM looks for when booting ??  By default, it looks for and
>>executes AUTOEXEC, i want to name it something else, maybe place it in a
>>subdirectory or something. Simply running a different BAT file from
>>within the AUTOEXEC is not what I want.
> 
>
>Go ahead and create the .BAT file you want to use in whatever 
>subdirectory you wish, then in your AUTOEXEC.BAT have only one line that
>refers to that batch file.  
>
>Example:
>
>(contents of your AUTOEXEC.BAT will look like this)
>c:\batchfiles\newauto
>
>
>In \batchfiles you would have your NEWAUTO.BAT that contains all the
>things your old AUTOEXEC.BAT had.


I used debug to change the name of autoexec.bat and config.sys in the system
files (ibmio and ibmdos). Actually, only one of them needs modification but
I don't remember which one. The only limitation is the new name must contain
the exact same number of charaters. I had changed \autoexec.bat to
\<255>\acadbf.bat and \config.sys to \<255>\cwcc.sys.   The <255> is ascii
value 255. This displays as a space.
I've preformed this change on DOS 3.1 and DOS 4.0 but it's been awhile and
I don't remember any addresses. I just searched for the file names and changed
them. I may have also modified command.com.

Dale Frye
Washington University in St. Louis

c60b-1eq@web-1e.berkeley.edu (Noam Mendelson) (04/03/91)

In article <1991Apr1.131809.1@dev8o.mdcbbs.com> campbell@dev8o.mdcbbs.com (Tim Campbell) writes:
>In article <9103291744.AA27144@cwns1.INS.CWRU.Edu>, aa581@cleveland.Freenet.Edu (Sandra Rozhon) writes:
>> In a message from (chrisb@hubcap.clemson.edu (Chris Behrens))
>>>Is there a program that will allow me to change the name of the file
>>>that COMMAND.COM looks for when booting ??  By default, it looks for and
>>>executes AUTOEXEC, i want to name it something else, maybe place it in a
>>>subdirectory or something. Simply running a different BAT file from
>>>within the AUTOEXEC is not what I want.
>> Go ahead and create the .BAT file you want to use in whatever 
>> subdirectory you wish, then in your AUTOEXEC.BAT have only one line that
>> refers to that batch file.  
>-- 
>Sorry I missed the original - I've done this before.  I beleive that if you
>take a hex-editor (debug will work - I used PC-tools) and load the invisible
>file (IBMDOS.SYS) you'll notice that the name of the file to execute is 
>spelled out (located near the end of the file - AUTOEXEC.BAT) - I simply
>renamed this to a different file - say, AUTOBOOT.BAT.
>I did this because I didn't want people messing with the file, so I created
>it and hid it.

You should _NOT_ modify IBMBIO.COM or IBMDOS.COM.  COMMAND.COM is
the executable which attempts to read the file \AUTOEXEC.BAT.  You can
use a binary file editor to change this to whatever you wish.  It
doesn't even need to be in the root directory.  But the full name of
the new file must not overrun the original name.  If the new name is
smaller, I would recommend padding the other bytes with NULLs.
And, as always, backup the original copy of COMMAND.COM.

+==========================================================================+
| Noam Mendelson   ..!agate!ucbvax!web!c60b-1eq | "I haven't lost my mind, |
| c60b-1eq@web.Berkeley.EDU                     |  it's backed up on tape  |
| University of California at Berkeley          |  somewhere."             |

frisk@rhi.hi.is (Fridrik Skulason) (04/04/91)

In a message from (chrisb@hubcap.clemson.edu (Chris Behrens))
 
>Is there a program that will allow me to change the name of the file
>that COMMAND.COM looks for when booting ??  By default, it looks for and
>executes AUTOEXEC, i want to name it something else, maybe place it in a
>subdirectory or something. Simply running a different BAT file from
>within the AUTOEXEC is not what I want.

The easiest way is just to patch COMMAND.COM.  Just run NU, search for 
the text "AUTOEXEC", and change it to whatever you want.

-frisk

sonny@charybdis.harris-atd.com (Bob Davis) (04/05/91)

In article <3005@krafla.rhi.hi.is> frisk@rhi.hi.is (Fridrik Skulason) writes:
>In a message from (chrisb@hubcap.clemson.edu (Chris Behrens))
> 
>>Is there a program that will allow me to change the name of the file
>>that COMMAND.COM looks for when booting ??  By default, it looks for and
>>executes AUTOEXEC, i want to name it something else, maybe place it in a
>>subdirectory or something. Simply running a different BAT file from
>>within the AUTOEXEC is not what I want.
>
>The easiest way is just to patch COMMAND.COM.  Just run NU, search for 
>the text "AUTOEXEC", and change it to whatever you want.
>

	I have not tried this but COMMAND.COM has an option /C that
invokes any specified command. So might one execute any batchfil.bat one
wishes on boot up by including the following line in CONFIG.SYS?:

	SHELL=COMMAND.COM /P /C batchfil.bat

As I say, I have not tried this. But I think I shall.


_____________________________________________________________________________
Bob Davis, UofALA alum \\ INTERNET: sonny@trantor.harris-atd.com  |  _   _  |
Harris Corporation, ESS \\    UUCP: ...!uunet!x102a!trantor!sonny |_| |_| | |
Advanced Technology Dept.\\ AETHER: K4VNO          |==============|_/\/\/\|_|
PO Box 37, MS 3A/1912     \\ VOICE: (407) 727-5886 | I SPEAK ONLY | |_| |_| |
Melbourne, FL 32902        \\  FAX: (407) 729-3363 | FOR MYSELF.  |_________|