ArticleslgStudy

science

AUTOEXEC.BAT

AUTOEXEC.BAT is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand AUTOEXEC.BAT rather than just read about it. In short: AUTOEXEC.BAT is a system file that was originally on DOS-type operating systems. It is a plain-text batch file in the root directory of the boot device.

Key takeaways

  • AUTOEXEC.BAT belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect AUTOEXEC.BAT to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of AUTOEXEC.BAT from memory before moving on to harder problems.

Reference excerpt

AUTOEXEC.BAT is a system file that was originally on DOS-type operating systems. It is a plain-text batch file in the root directory of the boot device. The name of the file is an abbreviation of "automatic execution", which describes its function in automatically executing commands on system startup; the filename was coined in response to the 8.3 filename limitations of the FAT file system family. In the autoexec.bat file one can execute every command being available either internally within the OS-specific command.com TSR or as an extra command (.com/.exe files)

Usage AUTOEXEC.BAT is read upon startup by all versions of DOS, including MS-DOS version 7.x as used in Windows 95 and Windows 98. Windows Me only parses environment variables as part of its attempts to reduce legacy dependencies, but this can be worked around. The filename was also used by Disk Control Program (DCP), an MS-DOS derivative by the former East-German VEB Robotron. In Korean editions of MS-DOS/PC DOS version 4.01 and higher (except for PC DOS 7 and 2000), if the current country code is set to 82 (for Korea) and no /P:filename is given and no default AUTOEXEC.BAT is found, COMMAND.COM will look for a file named KAUTOEXE.BAT instead in order to ensure that the DBCS frontend drivers will be loaded even without properly set up CONFIG.SYS and AUTOEXEC.BAT files. Under DOS, the file is executed by the primary copy of the command-line processor (typically COMMAND.COM) once the operating system has booted and the CONFIG.SYS file processing has finished. While DOS by itself provides no means to pass batch file parameters to COMMAND.COM for AUTOEXEC.BAT processing, the alternative command-line processor 4DOS supports a 4DOS.INI AutoExecParams directive and //AutoExecParams= startup option to define such parameters. Under Concurrent DOS, Multiuser DOS and REAL/32, three initial parameters will be passed to either the corresponding STARTxxy.BAT (if it exists) or the generic AUTOEXEC.BAT startup file, %1 holds the virtual console number, %2 the 2-digit terminal number (xx) (with 00 being the main console) and %3 the 1-digit session number (y). Windows NT and its descendants Windows XP and Windows Vista parse AUTOEXEC.BAT when a user logs on. As with Windows Me, anything other than setting environment variables is ignored. Unlike CONFIG.SYS, the commands in AUTOEXEC.BAT can be entered at the interactive command line interpreter. They are just standard commands that the computer operator wants to be executed automatically whenever the computer is started, and can include other batch files. AUTOEXEC.BAT is most often used to set environment variables such as keyboard, soundcard, printer, and temporary file locations. It is also used to initiate low-level system utilities, such as the following:

Virus scanners Disk caching software Mouse drivers Keyboard drivers CD drivers Miscellaneous other drivers

Example In early versions of DOS, AUTOEXEC.BAT was by default very simple. The DATE and TIME commands were necessary as early PC and XT class machines did not have a battery backed-up real-time clock as default.

In non-US environments, the keyboard driver (like KEYB FR for the French keyboard) was also included. Later versions were often much expanded with numerous third-party device drivers. The following is a basic DOS 5 type AUTOEXEC.BAT configuration, consisting only of essential commands:

This configuration sets common environment variables, loads a disk cache, places common directories into the default PATH, and initializes the DOS mouse and keyboard drivers. The PROMPT command sets the prompt to "C:\>" (when the working directory is the root of the C drive) instead of simply "C>" (the default prompt, indicating only the working drive and not the directory therein). In general, device drivers were loaded in CONFIG.SYS, and programs were loaded in the AUTOEXEC.BAT file. Some devices, such as mice, could be loaded either as a device driver in CONFIG.SYS, or as a TSR in AUTOEXEC.BAT, depending upon the manufacturer. In MS-DOS 6.0 and higher, a DOS boot menu is configurable. This can be used by users who wish to have optimized boot configurations for various programs, such as DOS games and Windows.

The GOTO %CONFIG% line informs DOS to look up menu entries that were defined within CONFIG.SYS. Then, these profiles are named here and configured with the desired specific drivers and utilities. At the desired end of each specific configuration, a GOTO command redirects DOS to the :END section. Lines after :END will be used by all profiles.

Dual-booting DOS and Windows 9x When installing Windows 95 over a preexisting DOS/Windows install, CONFIG.SYS and AUTOEXEC.BAT are renamed to CONFIG.DOS and AUTOEXEC.DOS. This is intended to ease dual booting between Windows 9x and DOS. When booting into DOS, they are temporarily renamed CONFIG.SYS and AUTOEXEC.BAT. Backups of the Windows 9x versions are made as .W40 files. Windows 9x also installs MSDOS.SYS, a configuration file, which will not boot Windows 95/98 if parameterBOOTGUI=0 is loaded, and instead a DOS prompt will appear on the screen (Windows can still be loaded by calling the WIN command (file WIN.COM). This file contains some switches that designate how the system will boot, one of which controls whether or not the system automatically goes into Windows. This "BootGUI" option must be set to "0" in order to boot to a DOS prompt. By doing this, the system's operation essentially becomes that of a DOS/Windows pairing, like with earlier Windows versions. Windows can be started as desired by typing WIN at the DOS prompt. When installing Caldera DR-DOS 7.02 and higher, the Windows version retains the name AUTOEXEC.BAT, while the file used by the DR-DOS COMMAND.COM is named AUTODOS7.BAT, referred to by the startup parameter /P:filename.ext in the SHELL directive. It also differentiates the CONFIG.SYS file by using the name DCONFIG.SYS.

OS/2 The equivalent to AUTOEXEC.BAT under OS/2 is the OS/2 STARTUP.CMD file. Genuine DOS sessions booted under OS/2 continue to use AUTOEXEC.BAT.

… excerpt ends here. Continue reading the full article.

Worked examples

Example 1 — a first encounter with AUTOEXEC.BAT

Start with the simplest possible case. Write down what AUTOEXEC.BAT claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to AUTOEXEC.BAT before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about AUTOEXEC.BAT ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of AUTOEXEC.BAT

In research
AUTOEXEC.BAT appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses AUTOEXEC.BAT in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
AUTOEXEC.BAT is common in secondary-school and first-year university syllabi. It links to neighbouring topics Configuration files, DOS files, MSX-DOS, so understanding it makes those chapters shorter.
In everyday life
Look for AUTOEXEC.BAT outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “AUTOEXEC.BAT” →

How to study AUTOEXEC.BAT in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what AUTOEXEC.BAT means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain AUTOEXEC.BAT out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is AUTOEXEC.BAT in simple terms?

AUTOEXEC.BAT is a system file that was originally on DOS-type operating systems. It is a plain-text batch file in the root directory of the boot device.

Why does AUTOEXEC.BAT matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study AUTOEXEC.BAT?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on AUTOEXEC.BAT.

Tags

  • Configuration files
  • DOS files
  • MSX-DOS

Keep exploring