DOS batch files

J

John

Where can I find information about the differences between
COMMAND.COM and CMD.EXE?

Where can I find information about using DOS environment
variables under Win 2000 and Win XP?

My batch files rely on environment variables. They used
to run fine under Win 95 and Win 98 SE, but they fail
under Win 2000 and Win XP Home. Sometimes there isn't
enough environment space to create the variable; sometimes
values I have stored in the environment don't seem to be
available later in the same batch file.
 
D

David Candy

Command.com is Dos Version 5 with one difference, it passes all commands to cmd to execute.

Try typing in command.com

dir /?
command /k dir /?

There are no long names in command.com.

You need to post your code not talk generalities.
 
B

Benny Pedersen

-----Original Message-----
Where can I find information about the differences between
COMMAND.COM and CMD.EXE?

Where can I find information about using DOS environment
variables under Win 2000 and Win XP?

My batch files rely on environment variables. They used
to run fine under Win 95 and Win 98 SE, but they fail
under Win 2000 and Win XP Home. Sometimes there isn't
enough environment space to create the variable; sometimes
values I have stored in the environment don't seem to be
available later in the same batch file.
.

http://users.cybercity.dk/~bse26236/
batutil/NEWS9.HTM#shell
 
A

Alex Nichol

John said:
Where can I find information about the differences between
COMMAND.COM and CMD.EXE?

Where can I find information about using DOS environment
variables under Win 2000 and Win XP?

My batch files rely on environment variables. They used
to run fine under Win 95 and Win 98 SE, but they fail
under Win 2000 and Win XP Home.

Cmd.exe is a 32 bit emulation of the DOS command environment -
Command.com is a real 16 bit one, but dates from DOS 5.0 and among other
things does not have LFN support.

For your purposes it is simplest to use command.com - bearing that LFN
restriction in mind - because you can r-click on it and set the
Properties for its PIF. There in the memory page you can set up things
like explicit environment space. If the LFNs matter, you can set these
up for a BAT, but it is more tricky - a shortcut made to a bat will be
a windows .lnk, not DOS .pif and does not give the flexibility of a
..pif. A way around that is to start by making a .pif shortcut to
command.com and then modifying the command line in the Properties to
point to the bat file instead.

You also need to look into setting things up in the default environment
so as to get the best DOS conventional memory, Edit the
windows\system32\config.nt and autoexec.nt files.

In config.nt have (apart from the large number of REM lines) just
EMM = B=4000 RAM
(note the exact spaces - either side of the first = and before RAM,
none next to the second =) and

dos=high, umb
device=%SystemRoot%\system32\himem.sys
files=40
(or higher files= if needed)

and in autoexec.nt have

REM Install DPMI support
lh %SystemRoot%\system32\dosx

with other earlier lh lines REM ed out, and then any SET or PATH lines
that may already be present at the end - add to them if desired.

This should give about 612K for a program, run from a shortcut made to
its .exe file, or to a bat file in the manner described above. R-click
the shortcut, Properties and on the Memory page you can set an explicit
value - rather than Auto - for any EMM or XMS memory it may need, and
for initial environment space. Even if you do not have a use for EMM,
have the line in config.nt as it enables the DOS High UMB and releases
quite a lot of conventional memory space
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top