1

I was reading about architecture of MS-DOS and came across files like Autoexec.bat and config.sys.

Autoexec.bat a batch (.bat) file, which contained commands that were used to initialize paths, environment variables, CWD, Prompt etc. This file (along with config.sys) got automatically executed during the startup procedure of the OS (if they exist).

Since, MS-DOS and Command Prompt are for the most part same (or similar) to each other, I thought the same procedure would be carried over in current iterations of Windows OS as well.

Which seems understandable as when we start cmd we already are at a specific CWD every time, have a set of locations specified in path etc.

But it turns out, Windows XP and later versions of Windows OS didn't had one.

So I was thinking how does everything gets initialized now, and why did Autoexec.bat got removed?

4
  • 1
    I don't think this is on-topic here. It should be on Retrocomputing – phuclv Dec 11 '19 at 16:16
  • @phuclv I was not aware of Retrocomputing branch of stack. If you think this question is more eligible over there, please consider a migration of this question – Vasu Deo.S Dec 11 '19 at 16:35
  • 1
    @phuclv I disagree. Retrocomputing is more about old computers, such as C64 and Atari. Even though we are talking about old PC stuff, I still think this belongs on SuperUser. – LPChip Dec 11 '19 at 17:06
  • MSDOS and Command Prompt are for the most part same No. It the same like to say that "Windows and Desktop (or Start-Run window) are for the most part same", for example. – Akina Dec 11 '19 at 18:59
5

Windows NT was a completely different OS that doesn't depend on DOS, therefore all of its descendants (including Windows 2000, not only XP and up) also don't use DOS things such as AUTOEXEC.BAT. That said there's an AUTOEXEC.NT in %SystemRoot%\system32 for setting up the environment when a DOS application is launched

Windows ME, despite in the Windows 9x line, also tried to move away from DOS. Therefore it only parses the environment variables in AUTOEXEC.BAT

1
  • This is the correct answer. Previous OS still relied on a DOS foundation but it got completely removed at Windows XP, which also did not require a config.sys and autoexec.bat file anymore. – LPChip Dec 11 '19 at 17:01
3

CONFIG.SYS set various options and loaded drivers with the DEVICE= and DEVICEHIGH= lines. It was read while DOS was starting.

When DOS completes initialization, it will start a shell. This is specified by the SHELL= line in CONFIG.SYS and is usually COMMAND.COM but doesn't have to be.

COMMAND.COM will run AUTOEXEC.BAT when it is started with the /P switch--this is typically specified in the CONFIG.SYS COMSPEC= line (examples) which means "make permanent" (it's not a "subshell"). A /D switch can suppress this.

The differences between DOS and other Microsoft operating systems goes back further than XP. It goes all the way back to 1993 when Windows was first working on the NT branch of Windows; then two years later when Windows 95 came out. Both the 9x branch and the NT branch, are different than MS-DOS under the hood - in the case of NT, vastly and extremely different.

NT Windows does the following different than MS-DOS as a rough, coarse overview of differences:

  • Uses the CPU's protected mode to create a barrier between kernel and userspace.
  • Expects multiple programs to be running and accessing the same disks, display, etc. apart from the primitive and limited TSR system of DOS.
  • Has a messaging system that supports event-based programming, which is needed to support the input methodology of a GUI mouse-and-window interface.
  • Has APIs (GDI, etc.) that need to be used to create windows, widgets, and modify the display.
  • Expects programs to make system calls to talk to all devices and doesn't allow direct access to hardware.
  • In the beginning NT didn't provide a lot of command-line tools available from COMMAND.COM or equivalent to achieve tasks in the operating system.

So the boot processes are different, and again, for the NT branch of Windows (which includes XP), extremely different.

Wikipedia has good articles on the details on Windows NT initialization.

9x Windows is much more like a multitasking extension on to of MS-DOS, with weird mechanisms in place to extend things to 32-bits. The boot process for 9x is a bit more similar to MS-DOS, this is a good description. Windows ME was the last of the 9x branch of Windows before Microsoft made XP both the consumer and business version of Windows, which is NT-based.

1

Startup is handled by Services and the Startup folder to start apps (See Task Manager Startup tab). There is no counterpart today to how DOS started. Since NT4, services can start without even logging on. Very different.

2
  • 2
    I'm voting this down because it has an upvote and is not actually answering the question. It states how it is now, but not exactly why and thus in my opinion is not correct in the way the other answer that I commented on is. I'll remove my downvote if someone else votes it down too though. – LPChip Dec 11 '19 at 17:02
  • Okay, the correct answer now has more upvotes, so I'll retract my downvote. – LPChip Dec 11 '19 at 17:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.