In most versions of DOS, when they are started from a medium that lacks an AUTOEXEC.BAT file, the very first thing COMMAND.COM does is ask the user to confirm the current date and time:

Starting PC DOS...

Current date is Thu 10-01-2020
Enter new date (mm-dd-yy): 
Current time is  9:42:41.44a
Enter new time: 

PC DOS Version 7.10
             (C)Copyright International Business Machines Corp 1981-2002.


This behaviour persisted until very late versions of DOS. Microsoft removed it only as late as in MS-DOS 7.0 (i.e. Windows 95), while IBM has never removed it from PC DOS (transcript above comes from PC DOS 7.10, downloaded from IBM themselves); DR-DOS likewise kept it until its very last versions. MS-DOS 1.0 will even require the user to enter a date unless AUTOEXEC.BAT is present, and wouldn’t proceed to a command prompt otherwise; later versions relaxed this, allowing the user to press Enter to confirm the currently set date. Even FreeCOM replicates this behaviour (as of 0.84-pre2).

This behaviour doesn’t seem necessary. Standard PC hardware includes a real-time clock powered by a battery; this allows current date and time to be maintained across power cycles, when the rest of the hardware is otherwise not functioning. It should be safe for the OS to assume that the current date and time are already set correctly upon booting.

Why is this behaviour present, why was it tied to the presence of AUTOEXEC.BAT and why did it persist for so long?

  • 1
    How certain are you that command.com did this automatically? I seem to remember Compaq DOS 3.1 requiring explicit date and time commands to be placed in autoexec.bat to get this prompt on startup.
    – mschaef
    Commented Oct 1, 2020 at 14:15
  • 8
    Pretty damn certain — I mean, it’s right there in the source code, and I tested some later versions too. Remember that even an empty AUTOEXEC.BAT file will suppress the prompt. Then though, there is also a possibility that Compaq DOS contained a modified version of COMMAND.COM. Commented Oct 1, 2020 at 18:12
  • 2
    It's also documented in tens if not hundreds of books about DOS, including Microsoft's own MS-DOS 3.3 User's Guide and User's Reference, which I just pulled off the shelf and checked; both under the date command and in the section on autoexec.bat. Google Books tells us that it's also in the 1984 COMPAQ User's Handbook.
    – JdeBP
    Commented Oct 2, 2020 at 6:31
  • Thanks, it was the presence of the autoexec.bat part of the statement that I missed. Not sure I ever booted without a startup script, so never saw the automatic display.
    – mschaef
    Commented Oct 2, 2020 at 20:01
  • 2
    From a different point of view, would there be a better event than boot to ask? Commented Oct 4, 2020 at 19:26

3 Answers 3


Because it used to be necessary.

While a battery-powered real-time clock is standard today, this wasn’t always the case. The very first IBM 5150 did not include an RTC chip; the system clock was maintained by the PIT interrupt running on the CPU, which in particular meant that disabling interrupts halted the system clock. When the computer was turned off, there was no hardware inside to maintain the clock. A number of third-party extension boards were available to overcome this problem; only with the PC/AT did an RTC chip become a built-in feature.

The above part is uncontroversial. The rest of this answer is considerably more speculative.

Skipping the date and time prompt when AUTOEXEC.BAT is present allowed the user to establish the current date and time at boot-up in some other way than prompting for manual input (which was probably exploited by drivers for the above-mentioned devices). In fact, this seems to have been the original purpose of AUTOEXEC.BAT in the first place: the /D switch used to skip processing AUTOEXEC.BAT was added primarily to suppress the date and time prompt, as implied by a comment in source code and overtly stated in internal documentation.

While an RTC eventually became a standard PC feature, Microsoft (and apparently Digital Research which developed DR DOS) probably wanted to maintain support for hardware which lacked it (including non-PC-compatible hardware), so instead of requiring the user to input the date and time, DOS started to allow the user to confirm the current setting. By the time computers without an RTC became vanishingly rare, this behaviour became a non-issue, as most computers would have an AUTOEXEC.BAT file present anyway, if only to set the PATH environment variable. DOS vendors therefore focused their attention on other concerns.

Also, even a battery-powered RTC would occasionally need to be manually adjusted for Daylight Saving Time and to correct clock skew (thanks @Ron Maupin for pointing the latter out), as the RTC on DOS computers was, infamously, usually set to local time and tended to drift a lot (as it does to this day, but now at least we have NTP to take care of it). Prompting the user to confirm the current time could serve as a mechanism ensuring the clock is set more-or-less accurately and that the DST adjustment is not overlooked. (This seems a weak justification now, especially given it’s a speculative one, and seems to contradict the AUTOEXEC.BAT connection somewhat. Myself, I would expect this behaviour to instead train the user to press Enter twice each time the system boots up without paying attention to the prompt. But maybe it is only in hindsight that we understand effects like banner blindness.)

With Windows 95, booting without an AUTOEXEC.BAT file became a much more common (and in fact, preferred) configuration: Andrew Schulman’s Unauthorized Windows 95 makes note that this was much emphasised in the press at the time. In a clean installation, only the non-English versions would create an AUTOEXEC.BAT file, where it would invoke MODE and KEYB commands setting up DOS locale settings. Only then did Microsoft decide that asking for the date and time on boot-up is superfluous and removed it, whether AUTOEXEC.BAT was present or not. (Even the DST justification wouldn’t have made sense any more, as DST adjustments are instead handled by the graphical interface.) Other DOS vendors apparently never felt the need to address it.

  • Isn't the battery only needed for when machine is plugged out of the power? Why didn't they power RTC from the mains, even when PC was off? Commented Oct 2, 2020 at 4:20
  • 19
    @MatejDrobnič Because the power switch controls mains in a standard AT supply, there was no mains available to have a standby supply, so a battery is necessary to keep time.
    – Justme
    Commented Oct 2, 2020 at 4:35
  • Rex Conn's 4DOS documented the /D switch, and it remains to this day, albeit with a modified meaning. jpsoft.com/help/cmdlineopts.htm
    – JdeBP
    Commented Oct 2, 2020 at 5:38
  • 5
    My understanding is that the original IBM PC didn't simply lack a battery; it lacked the real-time clock. When the system was powered up, the CPU would keep the time, so the RTC was only needed when the system was powered down. It would be pointless to supply a clock that was only necessary with power off, yet not include a battery. Think of the RTC as a watch that you could buy for your computer, which it would read upon startup.
    – Gabe
    Commented Oct 2, 2020 at 5:44
  • 1
    Comments are not for extended discussion; this conversation has been moved to chat.
    – wizzwizz4
    Commented Oct 3, 2020 at 13:40

It was necessary, because the early hardware did not contain a Real Time Clock (RTC) chip. The first IBM PC model to have an RTC chip as a standard feature and supported by BIOS was the IBM PC/AT, and earlier models could be retrofitted with an add-on RTC ISA card. So the models before AT cannot possibly know the current time automatically after powering the computer on or pushing the reset button, so it made sense to assume that by default, when there is no AUTOEXEC.BAT, the user wants to set the system time when DOS loads, and if there was an AUTOEXEC.BAT, it would prompt the user for date and time at a suitable point if necessary, or run an utility that reads the current time from the RTC addon card and sets the system time accordingly.


Standard PC hardware includes a real-time clock powered by a battery

I guess this is a valid assumption since IBM PC AT.

Older PCs (PC, PCjr, XT) has no RTC by default (due to Wikipedia).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .