The Echo
The Echo

Reputation: 1

What's the difference between MS-DOS and Batch?

I read that apparently MS-DOS and Batch are NOT the same thing, but that's how I've been taught.

I couldn't find sites or a Q&A on it so can anyone help shed some light?

Upvotes: 0

Views: 1837

Answers (2)

Dan Donoghue
Dan Donoghue

Reputation: 6206

MS Dos is the Microsoft Disk Operating System nowadays just reffered to as an OS. Windows has now become a part of the Microsoft OS and is a graphical layer allowing much more operability to the end user but we still have access to many DOS based commands.

This is done through the Command Prompt (CMD.EXE).

The Command prompt allows a terminal style (none graphical) environment where we can put together commands to interact with the machine. For example, DIR will give a directory listing for the current directory. These commands can be manipulated with parameters being passed in for example DIR /AD /S will use AD to list all Directories (not files) and /S will recurse through subdirectories.

If you spend any time working in a DOS environment there are many commands you would want to string together, You can create a text file with a .bat extension to allow this, running this "Batch" file will run the commands sequentially one after the other. It is exactly as the name implies, a Batch of commands for it to perform.

The Batch file DOES allow for some basic loops and a GoTo style jump. A perfect example of a Batch file in it's basic form was Autoexec.bat. This was used as your computer booted to fire off commands to load drivers for audio cards / graphics cards / network cards etc.

I STILL use the Command prompt very often, I find it easier to create a batch file from a bunch of formulas in Excel for 1 off repetitive commands and I can do this quicker than I probably could if I were to build a VBA solution to interact with the files.

Upvotes: 0

user4971703
user4971703

Reputation:

Batch file language is part of MSDos. It has also been part of MSDos successors - OS/2, Windows 16 bit, Win 32 on 9x as a MSDos 7, and on Win NT 32 bit as MSdos 5.5 which is the current one. 64 bit doesn't have MSDos.

In OS/2 IBM engineers tried bolting programming language constructs on to MSDos batch - Microsoft engineers updated this for Windows 2000. To remain compatible with MSDos batch this requires horrible hacks. The two command processors are

command.com - 16 bit MSDos command processor. There are many versions 1,2, 3, 3.3, 4, 5, 6, 6.22, (on 9x) 7, 7.1, (on Win NT) 5.5.

cmd.exe - 32 bit or 64 bit windows command processor that understands MSDos syntax as well. There are two main versions - NT4 and OS/2 and Windows 2000 and later.

In Windows if you type in command.com it sends your command to cmd.exe to be executed.

Try this.

Type in Start - Run

cmd

then in the console window

ver

Then type in Start - Run

command

then in the console window

ver

Then type in Start - Run

command /k ver

ALSO

Just because a program is a console program does not imply that either command processor is involved. It you type ftp in Start - Run only ftp.exe is running in that console.

Upvotes: 2

Related Questions