AUTOEXEC.BAT

AUTOEXEC.BAT

AUTOEXEC.BAT is the name of a system file found originally on the MS-DOS operating system. It is a plain-text batch file that is located in the root directory of the boot device. The name of the file stands for "automatic execution", which describes its function in automatically executing commands on system startup; the portmanteau was coined in response to the 8.3 filename limitations of the FAT file system family.

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 [ [http://support.microsoft.com/kb/288997/en-us "Subst" Command Does Not Work in Autoexec.bat File in Windows Millennium Edition ] ] , but this can be worked around. [ [http://www.geocities.com/mfd4life_2000/ Real DOS-Mode Patch for Windows Millennium ] ]

Under DOS, the file is executed once the operating system has booted and after the CONFIG.SYS file has been processed. 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. [ [http://support.microsoft.com/kb/124551 INFO: Configuring Parsing of the AUTOEXEC.BAT File ] ] 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 - SMARTDRV.EXE from Microsoft the most common
*Mouse drivers
*Keyboard drivers
*CD drivers
*Miscellaneous other drivers

Examples

MS-DOS

In early versions of DOS, AUTOEXEC.BAT was by default extremely 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.

echo offclsdatetimever

In non US environments the keyboard driver (like KEYBFR 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.x type AUTOEXEC.BAT configuration, consisting only of essential commands:

@echo offprompt $P$GPATH=C:DOS;C:WINDOWSset TEMP=C:TEMPset BLASTER=A220 I7 D1 T2lh smartdrv.exelh doskeylh mouse.com /Ywin

This configuration sets common environment variables, loads the disk cache SmartDrive on line six, places common directories into the default path, and initializes the DOS mouse / keyboard drivers, before starting Windows. The prompt command sets the command prompt to "C:>" instead of simply "C>".

In general, .SYS files were called in CONFIG.SYS, and .EXE programs such as the popular disk caching software "SmartDrive" provided by Microsoft with DOS 5x, were loaded in the AUTOEXEC.BAT file. Some devices, such as mice, could be loaded either as a .SYS file in CONFIG.SYS, or as a .COM in AUTOEXEC.BAT, depending upon the manufacturer. [ [http://support.microsoft.com/kb/96706 Mouse Doesn't Work with MS-DOS Shell ] ]

Lines prefixed with the string "REM" are comments (remarks) and are not run as part of AUTOEXEC.BAT. The "REM" lines are used for comments or to temporarily disable drivers (e.g. for a CD-ROM). An alternative, though less common, method for commenting is using double colons (::).

In MS-DOS 6 and higher, a DOS boot menu is configurable. This can be of great help to users who wish to have optimized boot configurations for various programs, such as DOS games and Windows. "(continued from CONFIG.SYS article)"

@echo offprompt $P$GPATH=C:DOS;C:WINDOWSset TEMP=C:TEMPset BLASTER=A220 I7 D1 T2goto %CONFIG%:WIN lh smartdrv.exe lh mouse.com /Y wingoto END:XMS lh smartdrv.exe lh doskey goto END:END

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.

Issues

One of the problems with the versions of Windows that ran on top of DOS, was a lack of conventional memory. This was due to the archaic design of the original x86 processor, which was originally only able to address 1024kB, or an effective 640kB of memory. While this was later extended with new processor modes, DOS was not able to load low level AUTOEXEC.BAT type drivers into extended memory.

Users were therefore presented with the baffling situation, of potentially having 8192K of physical memory, but were not able to run software that required a mere 512K of memory, because the DOS drivers in the AUTOEXEC.BAT file, especially CD-ROM and disk compression drivers, had taken up too much conventional memory.

Users were left to experiment with ‘Load High (LH)’ commands, based upon the EMM386 memory manager loaded in the CONFIG.SYS files, in order to try to move drivers from the 640K region, into the 640-1024kB range, via memory maps. Lack of conventional memory proved to be a particular issue for gamers, and generated numerous baffled calls to support desks. Some gamers that didn't know much were forced to maintain several boot disks, each with game specific PC configurations.

In reality this was easily solved by loading everything that was needed in the high memory through lh and devicehigh statements in autoexec.bat and config.sys, and of course using other drivers than the one that Microsoft supplied and thereby reducing memory usage down to 25%.

Resolving driver and conventional memory issues has been cited as a key reason for adoption of the Windows based Direct-X gaming interface [ [http://www.gamedev.net/reference/articles/article589.asp GameDev.net - all your game development needs ] ] , which could access the entire physical memory of the PC, and relied upon Windows drivers to access hardware. This was also solved by using 32-bit DOS programs and standard VESA drivers for graphics.

Dual-booting DOS and Win 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 9.x and DOS. When booting into DOS, they are temporarily renamed CONFIG.SYS and AUTOEXEC.BAT. Backups of the Win95 versions are made as .W40 files.

Windows 9x also installs a fake MSDOS.SYS file. 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, the Windows version retains the name AUTOEXEC.BAT, while the file preferred by the DR DOS loader is named AUTODOS7.BAT. It also differentiates the config.sys file by using the name DCONFIG.SYS [ [http://www.drdos.com/dosdoc/usergeng/01ugch1.htm] ]

OS/2 / NT

On Windows NT and its derivatives, Windows 2000, Windows Server 2003 and Windows XP, the equivalent file is called AUTOEXEC.NT and is located in the %SystemRoot%system32 directory. The file is not used during the operating system boot process; it is executed when the MS-DOS environment is started, which occurs when an MS-DOS application is loaded.

The AUTOEXEC.BAT file may often be found on Windows NT, in the root directory of the boot drive. Windows only considers the "SET" and "PATH" statements which it contains, in order to define environment variables global to all users. Setting environment variables through this file may be interesting if for example MS-DOS is also booted from this drive (this requires that the drive be FAT) or to keep the variables across a reinstall. This is an exotic usage today so this file usually remains empty. The TweakUI applet from the "PowerToys" collection allows to control this feature ("Parse Autoexec.bat at logon").

OS/2 did not use the AUTOEXEC.BAT file, instead using startup.cmd.

ee also

*MS-DOS
*CONFIG.SYS

References

External links

* [http://support.microsoft.com/?kbid=232557 Windows 98 Config.txt File]


Wikimedia Foundation. 2010.

Look at other dictionaries:

  • AUTOEXEC.BAT — (от англ. automatic execution  автоматическое исполнение и англ. batch  пакет, группа)  системный пакетный файл (файл, содержащий последовательность команд на языке интерпретатора командной строки  поставляемого в… …   Википедия

  • Autoexec.bat — est le nom d’un fichier système rencontré à l’origine dans le système d’exploitation MS DOS. Il s’agit d’un fichier batch de type .bat (fichier de commandes au format texte) situé à la racine du périphérique sur lequel l’ordinateur démarre. Le… …   Wikipédia en Français

  • Autoexec.bat — Saltar a navegación, búsqueda autoexec.bat es el nombre de un archivo de sistema encontrado en el sistema operativo MS DOS. Es un archivo por lotes en texto plano que se encuentra en el directorio raíz del dispositivo de arranque. Uso El archivo… …   Wikipedia Español

  • autoexec.bat — es el nombre de un archivo de sistema encontrado en el sistema operativo MS DOS. Es un archivo por lotes en texto plano que se encuentra en el directorio raíz del dispositivo de arranque. Es una abreviación de Autoexecutable.bat Uso El archivo… …   Wikipedia Español

  • AUTOEXEC.BAT — Saltar a navegación, búsqueda Autoexec.bat Obtenido de AUTOEXEC.BAT …   Wikipedia Español

  • autoexec.bat —   [Abk. für Auto execute Batch File; dt. »selbstausführende Stapeldatei«], bei DOS eine Stapeldatei, die nach jedem Start des Computers automatisch ausgeführt wird und in ihrer einfachsten Variante v. a. dazu dient, das Betriebssystem an die… …   Universal-Lexikon

  • AUTOEXEC.BAT — Die AUTOEXEC.BAT (ab Windows 95 kann es auch als autoexec.bat klein geschrieben werden) ist eine System Konfigurationsdatei unter MS DOS basierten Computersystemen. Der Name der Datei ist ein Kofferwort aus den Begriffen automatic („automatisch“) …   Deutsch Wikipedia

  • Autoexec.bat — Die autoexec.bat ist eine System Konfigurationsdatei unter MS DOS basierten Computersystemen. Der Name der Datei ist ein Kofferwort aus den Begriffen automatic („automatisch“) und execution („Durchführung“), wodurch ihre Funktion erklärt wird:… …   Deutsch Wikipedia

  • AUTOEXEC.BAT —    A contraction of Automatically Executed Batch. A special MS DOS batch file, located in the root directory of the startup disk, that runs automatically every time you start or restart your computer. The commands contained in AUTOEXEC.BAT are… …   Dictionary of networking

  • AUTOEXEC.BAT — ● adj et n. m. ►SYSTM Fichier de commandes exécutées en batch au démarrage d un système sous MS DOS. Toute une génération d informaticiens s est arraché les cheveux sur la configuration de ce fichier et de son petit frère, l abominable CONFIG.SYS …   Dictionnaire d'informatique francophone

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”