[comp.sys.ibm.pc] What files MUST be in the root directory?

pjd@hpuxa.ircc.ohio-state.edu (Peter J. Dotzauer) (08/06/89)

There seems to be some confusion about what files MUST be in the root
directory. For instance, the specifications for many drivers state that
one must put a line 'device=xyz.sys <parms>' into config.sys, and place
the file 'xyz.sys' into the root directory.

Of course, you can say 'device=c:\sys\xyz.sys' and put your file in the
directory c:\sys, thereby keeping your root directory uncluttered.

Obviously, the two hidden files and config.sys MUST absolutely be in
the root directory, but what about command.com, if you have a comspec
line in config.sys? I haven't dared to remove command.com from the root,
for fear of screwing something up.

-=-
Peter Dotzauer: Numerical Cartography Lab, Ohio State University
   Phone: (614) 292-1357 voice, 292-9180 fax, 293-0081 data
internet: pjd@hpuxa.ircc.ohio-state.edu ([128.146.1.5]        FidoNet: 1:226/120
  bitnet: ts3285@ohstvma             uucp: osu-cis!hpuxa.ircc.ohio-state.edu!pjd

cs75jmc@unccvax.UUCP (John Covington WN4BBJ) (08/08/89)

In article <189@nisca.ircc.ohio-state.edu>, pjd@hpuxa.ircc.ohio-state.edu (Peter J. Dotzauer) writes:
> There seems to be some confusion about what files MUST be in the root
> directory. For instance, the specifications for many drivers state that
> one must put a line 'device=xyz.sys <parms>' into config.sys, and place
>....
> Obviously, the two hidden files and config.sys MUST absolutely be in
> the root directory, but what about command.com, if you have a comspec
> line in config.sys? I haven't dared to remove command.com from the root,
> for fear of screwing something up.

You can place command.com in a subdirectory instead of the root if you
have the shell command in config.sys.  Something like:
shell=c:\dos\command.com c:\dos /p

However, I would warn you that if your config.sys file gets clobbered,
you won't be able to boot your machine.  You can boot without a
config.sys but you can't boot without command.com.  You'll have to
get out the floppy version of DOS and boot from that so you can fix
config.sys.

John Covington WN4BBJ        E-mail: cs75jmc@unccvax.UUCP
P.O. Box 217122              MCI Mail: JCOVINGTON 342-6957
Charlotte, NC 28221-7122     Packet Radio: WN4BBJ @ KK4L
(704) 537-7653               "Give it back, Eric, it's not yours" (the ICOM)

hollen@zeta.megatek.uucp (Dion Hollenbeck) (08/08/89)

From article <189@nisca.ircc.ohio-state.edu>, by pjd@hpuxa.ircc.ohio-state.edu (Peter J. Dotzauer):
> There seems to be some confusion about what files MUST be in the root
> directory. For instance, the specifications for many drivers state that
> one must put a line 'device=xyz.sys <parms>' into config.sys, and place
> the file 'xyz.sys' into the root directory.
> 
> Of course, you can say 'device=c:\sys\xyz.sys' and put your file in the
> directory c:\sys, thereby keeping your root directory uncluttered.
> 
> Obviously, the two hidden files and config.sys MUST absolutely be in
> the root directory, but what about command.com, if you have a comspec
> line in config.sys? I haven't dared to remove command.com from the root,
> for fear of screwing something up.

Peter has it real close with his suppositions.  The only files which MUST
be in the root directory are IO.SYS,  IBMBIO.SYS (hidden and 
incidentally, MUST be the first contiguous areas on the disk since the
boot code is only smart enough to read in the first n tracks, not 
smart enough to access the file system) and CONFIG.SYS.  Command.com
need not be in the root directory (or present at all if you prefer
a replacement command line process such as I do (4DOS by the way)),
but you must make the entry "SHELL=c:\4dos\4dos.exe" appropriate
for your command processor.  By making this entry, COMSPEC should be
automatically set for you, but I set it again.  Also, AUTOEXEC.BAT
must be in the root directory for it to be executed and the "/p" 
switch on the "SHELL=" line must be present for AUTOEXEC to be run
at boot.  The lack of the "/p" switch tells command.com (and other
command line processors mimic'ing it) that this instance of the shell
is the resident one and cannot be "exit'ed" out of like a secondary
shell can be.  Secondary shells, by default, will not run AUTOEXEC.

Some programs (like TIMESLIPS which I love dearly) give you no
choice about where they put some of their necessary files.  TIMESLIPS
creates SYS001.COM and SYS002.COM in the root directory.  If the
program has a loadable device driver, however, Peter is correct, you
can merely specify the path on the "device=" line in CONFIG.SYS.

A suggestion for setting up a newly formatted hard disk.  After
formatting and transferring your operating system (format /s) delete
COMMAND.COM from the root directory.  Use "mkdir" to create EVERY
directory and sub-directory entry you plan to use.  I take a
directory tree image of my hard disk before formatting by using the
command :  XCOPY C:\noexist.foo A:\ /s /e /v
This will copy the directory tree structure of my hard disk and 
all files named "noexist.foo" onto a floppy.  Since "noexist.foo"
does not exist, only the directory tree structure is copied.  After
formatting and removing COMMAND.COM, I use the reverse of the command
to re-create the directory tree structure on the target hard disk.
The intent of the switches is to copy all subdirectories even 
if they will beempty, verify copy after done, and copy all subdirectories
under the source directory.

When your hard disk has been set up with all the directory entries
first, if you ever get the disk trashed, it will be much easier 
for anyone who knows how to re-construct directories and FAT entries
by hand to recover your disk.

	Dion Hollenbeck             (619) 455-5590 x2814
	Megatek Corporation, 9645 Scranton Road, San Diego, CA  92121

        uunet!megatek!hollen       or  hollen@megatek.uucp

bob@omni.com (Bob Weissman) (08/08/89)

In article <189@nisca.ircc.ohio-state.edu>, pjd@hpuxa.ircc.ohio-state.edu
(Peter J. Dotzauer) writes:

> Obviously, the two hidden files and config.sys MUST absolutely be in
> the root directory, but what about command.com, if you have a comspec
> line in config.sys? I haven't dared to remove command.com from the root,
> for fear of screwing something up.

You can move COMMAND.COM.  I've been running that way (under MSDOS 3.30)
for over a year.  Just make sure you have a SHELL= (not COMSPEC) line in
CONFIG.SYS, for example:

	SHELL=C:\CMDS\COMMAND.COM C:\CMDS /E:640 /P

Note the first argument to COMMAND tells it where to find itself.

(I do this so I can run a command interpreter conveniently from under MS
Word, which allows you to run an arbitrary program from under it, but has
no command to just spawn COMMAND.COM.  I've put COMMAND.COM in my \CMDS
directory, along with the rest of the MSDOS executables.)

Oh, and I believe that AUTOEXEC.BAT must also be in the root directory.


-- 
Bob Weissman
Domainish: bob@omni.com
UUCPish:   ...!{amdahl,apple,pyramid,sgi,tekbspa,uunet}!koosh!bob

nather@ut-emx.UUCP (Ed Nather) (08/08/89)

In article <189@nisca.ircc.ohio-state.edu>, pjd@hpuxa.ircc.ohio-state.edu (Peter J. Dotzauer) writes:
> 
> Obviously, the two hidden files and config.sys MUST absolutely be in
> the root directory, but what about command.com, if you have a comspec
> line in config.sys? I haven't dared to remove command.com from the root,
> for fear of screwing something up.

I keep command.com in a directory I call "systm", and have the following
line in my config.sys file:

shell=c:\systm\command.com  c:\systm /P /E:32

which tells the MS-DOS startup routines where to find command.com on
boot-up (the first entry), where to find it for reloading, if need be
(the second entry), makes this permanent (the /P) and sets aside
32 paragraphs of environment space (I'm using DOS 3.1.  For DOS 3.3
you would use E:512 to set aside 512 bytes, the same as 32 paragraphs.
This change is brought to you by the Upward Compatibility Group at
Microsoft, at no extra charge whatsoever.).
-- 
Ed Nather
Astronomy Dept, U of Texas @ Austin

mrichey@orion.cf.uci.edu (Mike Richey) (08/09/89)

In article <189@nisca.ircc.ohio-state.edu> pjd@hpuxa.ircc.ohio-state.edu (Peter J. Dotzauer) writes:
>There seems to be some confusion about what files MUST be in the root
>directory. For instance, the specifications for many drivers state that
>one must put a line 'device=xyz.sys <parms>' into config.sys, and place
>the file 'xyz.sys' into the root directory.
>
If you use a package such as VFeature, which is a hard disk driver, that
driver (fixt_dsk.sys i think) must be in the root directory. if it's
not then the hard disk won't boot up. But device=c:\dos\ansi.sys is a 
valid config.sys entry, so is the shell=c:\dos\command.com. The only other
file that would need to be in the root is AUTOEXEC.BAT. I use this on various
machines so that the command.com does not get overwritten.

Comspec is the command as to where to load command.com from after exiting
applications. The shell command is what you need to look up in you DOS manual.

ho@fergvax.unl.edu (Tiny Bubbles...) (08/09/89)

From article <189@nisca.ircc.ohio-state.edu>, by pjd@hpuxa.ircc.ohio-state.edu (Peter J. Dotzauer):
> Obviously, the two hidden files and config.sys MUST absolutely be in
> the root directory, but what about command.com, if you have a comspec
> line in config.sys? I haven't dared to remove command.com from the root,
> for fear of screwing something up.

Command.com can be moved under DOS 3.0;  I'm not sure about 2.0, I think
you're stuck with it there.  

To do it under 3.0+, put

SHELL=[path]COMMAND.COM [path]

Example:  command is in your \DOS directory.  Use

SHELL=C:\DOS\COMMAND.COM C:\DOS 

That second path is important -- that's what lets the system FIND the file
for subsequent loads (via the COMSPEC variable).

I don't have 2.0, but I had heard there were problems trying to implement
this over there.
---
	... Michael Ho, University of Nebraska    <ho@fergvax.unl.edu>

hollen@eta.megatek.uucp (Dion Hollenbeck) (08/09/89)

From article <1588@unccvax.UUCP>, by cs75jmc@unccvax.UUCP (John Covington WN4BBJ):
> In article <189@nisca.ircc.ohio-state.edu>, pjd@hpuxa.ircc.ohio-state.edu (Peter J. Dotzauer) writes:
>> There seems to be some confusion about what files MUST be in the root
>> directory. For instance, the specifications for many drivers state that
>> one must put a line 'device=xyz.sys <parms>' into config.sys, and place
>>....
> ...
> However, I would warn you that if your config.sys file gets clobbered,
> you won't be able to boot your machine.  You can boot without a
> config.sys but you can't boot without command.com.  You'll have to
> get out the floppy version of DOS and boot from that so you can fix
> config.sys.
> 


John has a very valid point which I would make a further 
recommendation to.  Each and every time your re-configure your
system, create a boot floppy with your new CONFIG.SYS, AUTOEXEC.BAT,
and all the device drivers you use to access the hardware in
your system.  That way, at any time you have problems with your
hard disk booting, you have a bootable floppy which understands
the current configuration of your system and will duplicate
your hardware conditions as if booted from the hard disk.  Don't
forget to leave your path statement IN just as it is on your
hard disk.  After all, the majority of your utilities will be on
your hard disk and accessed via the path statement.  It is also
very handy to have a very simple text editor on this boot disk
so you can edit any files necessary in the process of trying to
get your system going.  I would never be without my bootable
floppy; it has saved my bacon numerous times.
	Dion Hollenbeck             (619) 455-5590 x2814
	Megatek Corporation, 9645 Scranton Road, San Diego, CA  92121

        uunet!megatek!hollen       or  hollen@megatek.uucp

dale@wucs1.wustl.edu (Dale Frye) (08/12/89)

I have moved everything possible out of the root dir. I have a second
partition on the hard disk that is write protected. I put command.com
and all device drivers there (except the device driver that enables
the second partition of course!). I modified the names of autoexec.bat
and config.sys in the operating system so that they are now in a
subdirectory on C:. The full pathname must be the same length as the
original name so I have A\acadbf.bat and A\cwcc.sys. Where A is a
one charater subdir name. The name of my subdir is ASCII value 255
<ALT 255>. This displays as a space in a dir listing. This keeps most
people out. I also mark the subdir as hidden. The autoexec (acadbf.bat)
file has one line: @d:\A\a1.bat .  I keep all the programs on drive D:
(the second partition that is read only) and let the students use C:
for temp space.  If C: is clobbered then all I have to do is boot a floppy
and reformat drive C:. This takes all of 1 minute or so.

Problems:
 Some programs require COMMAND.COM to exist on C:\ when they shell to DOS.
(EX. Kermit) I keep a copy of command.com there just for this purpose. It
is marked hidden and readonly. The reason I put command.com on drive D: is
to give it max protection from viruses. The command.com on C: is not used
very much.

The format program copies the modified system to a floppy ( /s option).
A copy of the original operating system must be copied back on to the
floppy. COPY is not good enough. I wrote some programs that will copy
the system tracks of a floppy and save them to a file and to copy that
file back to the system tracks.

Some editors don't like <ALT> 255. SideKick and PCTools work fine. 
SideKick Plus refuses to let me use it. 




Dale Frye


 

davidr@hplsla.HP.COM (David M. Reed) (08/12/89)

If you want your root directory to be empty, then you should note the comment
made earlier:

    Now go and hide your CONFIG.SYS and AUTOEXEC.BAT files.

The two boot files are already hidden, so you do not see them.  You can
move COMMAND.COM out of the root directory, as many have suggested, but
you should not make it a hidden or read-only file because many programs
will stumble.  But it really handy to make the CONFIG and AUTOEXEC files
hidden, thus guarding against accidental deletion (which often seems most
likely to occur in a root directory), and inadvertent modification (as
one must remember to unhide the file before most editors will allow you
access to it or being able to save it).

ho@fergvax.unl.edu (Tiny Bubbles...) (08/14/89)

From article <5190031@hplsla.HP.COM>, by davidr@hplsla.HP.COM (David M. Reed):
> The two boot files are already hidden, so you do not see them.  You can
> move COMMAND.COM out of the root directory, as many have suggested, but
> you should not make it a hidden or read-only file because many programs
> will stumble.  But it really handy to make the CONFIG and AUTOEXEC files

What happens when you set your COMMAND.COM to read-only?

A long time ago, when the big virus scare was up, I changed my COMMAND to
read-only... no bad things have happened to me yet.  Wonder what's coming.

Blah, blah, blah.  I have an ornery post program.  It gets mad when I don't
waste bandwidth at the bottom of an article where I quoted a bunch of text
with a quick question or answer.  Blah, blah, blah.



Boo!
---
	... Michael Ho, University of Nebraska    <ho@fergvax.unl.edu>

aland@infmx.UUCP (Dr. Scump) (08/16/89)

In article <16741@ut-emx.UUCP> nather@ut-emx.UUCP (Ed Nather) writes:
|I keep command.com in a directory I call "systm", and have the following
|line in my config.sys file:
|
|shell=c:\systm\command.com  c:\systm /P /E:32
|
|which tells the MS-DOS startup routines where to find command.com on
|boot-up (the first entry), where to find it for reloading, if need be
|(the second entry), makes this permanent (the /P) and sets aside
|32 paragraphs of environment space (I'm using DOS 3.1.  For DOS 3.3
|you would use E:512 to set aside 512 bytes, the same as 32 paragraphs.
|This change is brought to you by the Upward Compatibility Group at
|Microsoft, at no extra charge whatsoever.).
|Ed Nather

Where is that second parameter (c:\systm) documented?  It sure isn't
in the PC-DOS 3.3 manual (see pp. 4-42)  does it apply to earlier 
versions of DOS only?  Is it undocumented?  Is it necessary?

--
    Alan S. Denney  @  Informix Software, Inc.    
         {pyramid|uunet}!infmx!aland                 "I want to live!
   --------------------------------------------       as an honest man,
    Disclaimer:  These opinions are mine alone.       to get all I deserve
    If I am caught or killed, the secretary           and to give all I can."
    will disavow any knowledge of my actions.             - S. Vega

ho@fergvax.unl.edu (Tiny Bubbles...) (08/17/89)

From article <2120@infmx.UUCP>, by aland@infmx.UUCP (Dr. Scump):
> In article <16741@ut-emx.UUCP> nather@ut-emx.UUCP (Ed Nather) writes:
> |I keep command.com in a directory I call "systm", and have the following
> |line in my config.sys file:
> |
> |shell=c:\systm\command.com  c:\systm /P /E:32
> |
> 
> Where is that second parameter (c:\systm) documented?  It sure isn't
> in the PC-DOS 3.3 manual (see pp. 4-42)  does it apply to earlier 
> versions of DOS only?  Is it undocumented?  Is it necessary?

Does it apply to earlier versions of DOS only?  No.  It's required for all.
COMMAND can't check argv[0], because argv[0] is stored after the end of the
environment (kludge!).  By definition, the top-level COMMAND knows that it
is the top dog by making sure its environment is NULL.  As such, no argv[0]
(starting path, for non 'C' hackers) can be stored or retrieved, unlike all
other programs under DOS 3.0+ which /can/ find their environments.

Is it undocumented?  As far as I'm concerned, everything in an IBM manual
is undocumented. :-)  As for whether it's in the manual, I'm not sure.  I
never read it if I want to know something important.  I may have read about
it on the net.

Is it necessary?  Yes.  Without it, your COMSPEC will be set wrong (it will
point to the root directory, as COMSPEC=C:\COMMAND.COM) and you won't be
able to remove COMMAND from the root directory.
---
	... Michael Ho, University of Nebraska
Internet: ho@fergvax.unl.edu		USnail:  115 Nebraska Union
UUCP:	  !Im!not!sure!how...			 Lincoln, NE 68588-0461

stephen@ziebmef.uucp (Stephen M. Dunn) (08/19/89)

In article <2120@infmx.UUCP> aland@infmx.UUCP (alan denney) writes:
$In article <16741@ut-emx.UUCP> nather@ut-emx.UUCP (Ed Nather) writes:
[...]
$|shell=c:\systm\command.com  c:\systm /P /E:32
$Where is that second parameter (c:\systm) documented?  It sure isn't
$in the PC-DOS 3.3 manual (see pp. 4-42)  does it apply to earlier 
$versions of DOS only?  Is it undocumented?  Is it necessary?

   Yeah, DOS 3.30 doesn't document such a feature; in fact, it tells
you specifically that if your shell (be it command.com or otherwise) isn't
called COMMAND.COM and isn't in the root directory of your boot disk, you
have to set up the COMSPEC variable yourself.  Of course, if this is in
fact an undocumented feature, it wouldn't be the first time.

   As far as I know, DOS 3.00 was the first one to allow you to specify
the SHELL= line; PC-DOS 3.00's manual says you should put
   SHELL=[d:][\path\]COMMAND.COM
and mentions nothing at all about parameters (in fact, COMMAND isn't even
listed in the section dealing with commands!)  I don't have access to any
manuals for DOS 3.10 or 3.20; DOS 3.30 says COMMAND has only three
possible parameters (/C, /E and /P), and I don't have any 4.00 manuals
(and I'm not about to play around formatting diskettes /s under each
version of DOS and playing with the SHELL= line!)

-- 
-------------------------------------------------------------------------------
! Stephen M. Dunn              stephen@ziebmef.UUCP ! DISCLAIMER:  Who'd ever !
!---------------------------------------------------! claim such dumb ideas?  !
! I have become comfortably numb ...                ! I sure as heck wouldn't !