AUTOEXEC.BAT

from Wikipedia, the free encyclopedia

The AUTOEXEC.BAT (from Windows 95 it may as autoexec.batbe lowercase) is a system configuration file under MS-DOS -based computer systems. The name of the file is a suitcase word made up of the terms automatic ("automatically") and execution ("execution"), which explains its function: It automatically executes commands when the system is started. Technically it is a batch processing file ("batch file"), recognizable by the file extension .bat . The file must be in the root directory of the active partition . It is called when the system is started by COMMAND.COM.

use

This AUTOEXEC.BATis used with MS-DOS as well as with MS-Windows operating systems that use MS-DOS for starting ( Windows 3.x , Windows 9x ). The file contains settings and commands that individually adapt the operating system (starting drivers , localization, etc.).

The file is executed by it when the system is started as soon as it COMMAND.COMis loaded into the memory, in Windows systems before the graphical user interface is started. Unlike CONFIG.SYSthat which is executed by MSDOS.SYS(MS-DOS), IBMDOS.COM(PC DOS, DR-DOS) or IO.SYS(Windows 9x), the can AUTOEXEC.BATalso be started directly in the command line of the DOS prompt.

The respective operating system also starts if it is AUTOEXEC.BATnot available.

Applications that are to be executed when the Windows environment is started use different mechanisms (for example, entries in the Windows registry or in the Startup folder). See also Windows autostart options .

construction

The text-based batch file AUTOEXEC.BATcan be changed by the user according to his wishes. Therefore there is no fixed content, only common entries. A very simple example is:

@ECHO OFF
PROMPT $p$g

These lines prevent the output of the commands during the execution of the script ( @ECHO OFF) and set the DOS prompt so that the current path ( $p) followed by a >( $g) appears.

In most cases, this is AUTOEXEC.BATsignificantly expanded, for example with this file from a system with MS-DOS and Windows 3.11 :

@ECHO OFF
REM -- Festplattencache:
C:\WINDOWS\SMARTDRV.EXE 2038 512
PROMPT $p$g
PATH C:\DOS;C:\WINDOWS;C:\WINDOWS\SYSTEM;
SET TEMP=C:\TEMP
MODE LPT1:,,P >NUL
C:\DOS\SHARE.EXE /F:150 /L:1500
C:\WINDOWS\MOUSE.COM /Y
CD \WINDOWS
WIN

This configuration loads the mouse driver , starts the hard disk cache ( SMARTDRV.EXE) and network file locking service ( SHARE.EXE) services and also defines the list of standard directories for searching for executable files. It also defines other various settings and finally starts Windows.

Lines that REMbegin with the designation contain comments and do not represent commands. Accordingly, the REMcommand is always used when parts are to be commented on or when individual functions are temporarily switched off, for example various drivers. Another method of commenting is two colons (: :), but this is very rarely used.

Boot menu

From MS-DOS version 6.0 there is the option of setting up CONFIG.SYSa boot menu in order to easily enable various configurations of the system setup. The selected configuration can be AUTOEXEC.BATdetermined in the and accordingly it can only execute certain sections of its content.

Windows NT

In the Windows NT -Betriebssystemlinie and its advancements from Windows 2000 is Autoexec.ntthe equivalent of autoexec.bat, part of the 16-bit MS-DOS subsystem and below %SystemRoot%\system32. This file is not loaded when the computer starts, but only when a DOS-based application is to be started.

However, autoexec.bat can often be found in Windows NT systems. In this case, the operating system only uses the SETcommands specified with which the environment variables can be set for all users of a computer (as an alternative to entries in the registry). Setting environment variables in this file is also an interesting option if a DOS system is starting up in addition to the Windows system (this, however, requires the use of the FAT file system) or if the settings are still available after a new installation. This function can be controlled through the TweakUI application of the PowerToys collection ( Parse Autoexec.bat at logon ).

To start the command line interpreter cmd.exe(opening an “MS-DOS prompt”), a corresponding batch file can be entered in the registry or given to the program as a parameter /k c:\dos\shell.batwhen it is called (the corresponding shell.batcommand then contains the commands).

The “16-bit MS-DOS subsystem” is no longer included in 64-bit versions of Windows.

Other operating systems

A corresponding file can be found under AmigaDOS : The commands that are in the file startup-sequenceare executed during the boot process . However, it is a sprerequisite that the file itself is in the directory of the boot medium.

Under Apple ProDOS is BASIC file STARTUP BASexecuted.

Under OpenVMS is SYS$MANAGER:SYLOGIN.COMrunning.

Under Multics is start_up.ecexecuted.

Web links

Individual evidence

  1. Error message “16-bit MS-DOS subsystem” when executing an MS-DOS or 16-bit Windows program in Windows Server 2003 or Windows 2000 Server. In: Support. Microsoft, accessed April 1, 2020 .