Autoexec bat windows 7 что это

From Wikipedia, the free encyclopedia

From Wikipedia, the free encyclopedia

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.

Usage[edit]

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,[1] but this can be worked around.[2]

The filename was also used by Disk Control Program [de] (DCP), an MS-DOS derivative by the former East-German VEB Robotron.[3]

In Korean versions of MS-DOS/PC DOS 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.[4]

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.[5] 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,[6] %2 the 2-digit terminal number (xx) (with 00 being the main console) and %3 the 1-digit session number (y).[7]

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.[8] 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[edit]

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.

@ECHO OFF
CLS
DATE
TIME
VER

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:

@ECHO OFF
PROMPT $P$G
PATH C:DOS;C:WINDOWS
SET TEMP=C:TEMP
SET BLASTER=A220 I7 D1 T2
LH SMARTDRV.EXE
LH DOSKEY
LH MOUSE.COM /Y

This configuration sets common environment variables, loads a disk cache, places common directories into the default PATH, and initializes the DOS mouse / 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.[9]

In MS-DOS 6.0 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.

@ECHO OFF
PROMPT $P$G
PATH C:DOS;C:WINDOWS
SET TEMP=C:TEMP
SET BLASTER=A220 I7 D1 T2
GOTO %CONFIG%
:WIN
LH SMARTDRV.EXE
LH MOUSE.COM /Y
WIN
GOTO 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.

Dual-booting DOS and Windows 9x[edit]

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.[10][11][12]

OS/2[edit]

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

Windows NT[edit]

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 a 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-formatted) or to keep the variables across a reinstall. This is an exotic usage today so the file usually remains empty. The Tweak UI applet from the Microsoft PowerToys collection allows to control this feature (Parse AUTOEXEC.BAT at logon).

See also[edit]

  • COMMAND.COM
  • IBMBIO.COM / IO.SYS
  • IBMDOS.COM / MSDOS.SYS
  • SHELL (CONFIG.SYS directive)
  • CONFIG.SYS
  • AUTORUN.INF

References[edit]

  1. ^ ««Subst» Command Does Not Work in Autoexec.bat File in Windows Millennium Edition». Revision 1.3. Microsoft. 2007-01-31. KB288997. Q288997. Archived from the original on 2011-05-24. Retrieved 2007-07-04.
  2. ^ Ashumov, V. (2017) [2007]. «Some features of MS-DOS 8.0». Archived from the original on 2010-10-22. Retrieved 2010-11-21.
  3. ^ Kurth, Rüdiger; Groß, Martin; Hunger, Henry (2016-11-29) [2007]. «Betriebssystem DCP». www.robotrontechnik.de (in German). Archived from the original on 2019-04-03. Retrieved 2019-04-28.
  4. ^ Paul, Matthias R. (2001-10-25). «System file settings». Newsgroup: comp.os.msdos.programmer. Archived from the original on 2017-09-10. Retrieved 2014-08-06. […] [W]hat’s KAUTOEXE.BAT? […] This is a special case in Korean MS-DOS/PC DOS 4.01+. It is still present in MS-DOS 7.10 (Windows 98SE, I’m not sure about 8.0 aka ME), but it vanished in PC DOS 7/2000. If the current country code is 82 […] and […] no /P:filename was specified *and* no default AUTOEXEC.BAT file was found, COMMAND.COM will instead execute a file named KAUTOEXE.BAT, if it exists. Presumably, this is used to ensure that the DBCS frontend drivers are loaded without properly set up CONFIG.SYS or AUTOEXEC.BAT files. […]
  5. ^ Brothers, Hardin; Rawson, Tom; Conn, Rex C.; Paul, Matthias R.; Dye, Charles E.; Georgiev, Luchezar I. (2002-02-27). 4DOS 8.00 online help.
  6. ^ Concurrent DOS Multiuser/Multitasking Operating System — Print Spooler User’s Guide (PDF). Digital Research. 1989-02-01. Archived (PDF) from the original on 2016-11-05. Retrieved 2014-08-12.
  7. ^ «FYI — Configuring CSPOOL». Novell. 1992-12-29. FYI.M.1901. Archived from the original on 2016-11-05. Retrieved 2014-08-12.
  8. ^ «INFO: Configuring Parsing of the AUTOEXEC.BAT» (1 ed.). Microsoft. 2007-03-20 [2002-06-11]. Q124551. Archived from the original on 2019-04-21. Retrieved 2017-09-10.
  9. ^ «Mouse Doesn’t Work with MS-DOS Shell». Microsoft. 2007 [1994]. KB96706. Q96706. Archived from the original on 2007-03-11. Retrieved 2006-10-15.
  10. ^ «Chapter 1: Introduction to DR-DOS». Caldera DR-DOS 7.02 User Guide. Caldera, Inc. 1998 [1993, 1997]. Archived from the original on 2016-11-05. Retrieved 2013-08-10.
  11. ^ Caldera DR-DOS 7.02 User Guide. Caldera, Inc. 1998 [1993, 1997]. Archived from the original on 2016-11-05. Retrieved 2013-08-10.
  12. ^ «FYI — Configuring LOADER.COM for Multiple Operating System Boots — Installing DR DOS on NEC DOS 3.3 Partitions». Novell. 1993-01-05. FYI.M.1909. Archived from the original on 2016-11-05. Retrieved 2014-08-12.

From Wikipedia, the free encyclopedia

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.

Usage[edit]

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,[1] but this can be worked around.[2]

The filename was also used by Disk Control Program [de] (DCP), an MS-DOS derivative by the former East-German VEB Robotron.[3]

In Korean versions of MS-DOS/PC DOS 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.[4]

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.[5] 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,[6] %2 the 2-digit terminal number (xx) (with 00 being the main console) and %3 the 1-digit session number (y).[7]

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.[8] 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[edit]

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.

@ECHO OFF
CLS
DATE
TIME
VER

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:

@ECHO OFF
PROMPT $P$G
PATH C:DOS;C:WINDOWS
SET TEMP=C:TEMP
SET BLASTER=A220 I7 D1 T2
LH SMARTDRV.EXE
LH DOSKEY
LH MOUSE.COM /Y

This configuration sets common environment variables, loads a disk cache, places common directories into the default PATH, and initializes the DOS mouse / 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.[9]

In MS-DOS 6.0 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.

@ECHO OFF
PROMPT $P$G
PATH C:DOS;C:WINDOWS
SET TEMP=C:TEMP
SET BLASTER=A220 I7 D1 T2
GOTO %CONFIG%
:WIN
LH SMARTDRV.EXE
LH MOUSE.COM /Y
WIN
GOTO 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.

Dual-booting DOS and Windows 9x[edit]

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.[10][11][12]

OS/2[edit]

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

Windows NT[edit]

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 a 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-formatted) or to keep the variables across a reinstall. This is an exotic usage today so the file usually remains empty. The Tweak UI applet from the Microsoft PowerToys collection allows to control this feature (Parse AUTOEXEC.BAT at logon).

See also[edit]

  • COMMAND.COM
  • IBMBIO.COM / IO.SYS
  • IBMDOS.COM / MSDOS.SYS
  • SHELL (CONFIG.SYS directive)
  • CONFIG.SYS
  • AUTORUN.INF

References[edit]

  1. ^ ««Subst» Command Does Not Work in Autoexec.bat File in Windows Millennium Edition». Revision 1.3. Microsoft. 2007-01-31. KB288997. Q288997. Archived from the original on 2011-05-24. Retrieved 2007-07-04.
  2. ^ Ashumov, V. (2017) [2007]. «Some features of MS-DOS 8.0». Archived from the original on 2010-10-22. Retrieved 2010-11-21.
  3. ^ Kurth, Rüdiger; Groß, Martin; Hunger, Henry (2016-11-29) [2007]. «Betriebssystem DCP». www.robotrontechnik.de (in German). Archived from the original on 2019-04-03. Retrieved 2019-04-28.
  4. ^ Paul, Matthias R. (2001-10-25). «System file settings». Newsgroup: comp.os.msdos.programmer. Archived from the original on 2017-09-10. Retrieved 2014-08-06. […] [W]hat’s KAUTOEXE.BAT? […] This is a special case in Korean MS-DOS/PC DOS 4.01+. It is still present in MS-DOS 7.10 (Windows 98SE, I’m not sure about 8.0 aka ME), but it vanished in PC DOS 7/2000. If the current country code is 82 […] and […] no /P:filename was specified *and* no default AUTOEXEC.BAT file was found, COMMAND.COM will instead execute a file named KAUTOEXE.BAT, if it exists. Presumably, this is used to ensure that the DBCS frontend drivers are loaded without properly set up CONFIG.SYS or AUTOEXEC.BAT files. […]
  5. ^ Brothers, Hardin; Rawson, Tom; Conn, Rex C.; Paul, Matthias R.; Dye, Charles E.; Georgiev, Luchezar I. (2002-02-27). 4DOS 8.00 online help.
  6. ^ Concurrent DOS Multiuser/Multitasking Operating System — Print Spooler User’s Guide (PDF). Digital Research. 1989-02-01. Archived (PDF) from the original on 2016-11-05. Retrieved 2014-08-12.
  7. ^ «FYI — Configuring CSPOOL». Novell. 1992-12-29. FYI.M.1901. Archived from the original on 2016-11-05. Retrieved 2014-08-12.
  8. ^ «INFO: Configuring Parsing of the AUTOEXEC.BAT» (1 ed.). Microsoft. 2007-03-20 [2002-06-11]. Q124551. Archived from the original on 2019-04-21. Retrieved 2017-09-10.
  9. ^ «Mouse Doesn’t Work with MS-DOS Shell». Microsoft. 2007 [1994]. KB96706. Q96706. Archived from the original on 2007-03-11. Retrieved 2006-10-15.
  10. ^ «Chapter 1: Introduction to DR-DOS». Caldera DR-DOS 7.02 User Guide. Caldera, Inc. 1998 [1993, 1997]. Archived from the original on 2016-11-05. Retrieved 2013-08-10.
  11. ^ Caldera DR-DOS 7.02 User Guide. Caldera, Inc. 1998 [1993, 1997]. Archived from the original on 2016-11-05. Retrieved 2013-08-10.
  12. ^ «FYI — Configuring LOADER.COM for Multiple Operating System Boots — Installing DR DOS on NEC DOS 3.3 Partitions». Novell. 1993-01-05. FYI.M.1909. Archived from the original on 2016-11-05. Retrieved 2014-08-12.

Файл AUTOEXEC.BAT играет
особую роль в операционной системе MS
DOS: являясь по содержанию обычным
командным файлом, он автоматически
выполняется при каждой загрузке
операционной системы. Его основное
назначение состоит в сохранении и
оперативной установке значений параметров
операционной среды для конкретного
пользователя конкретного компьютера.
Среди команд, которые особенно часто
используются в составе AUTOEXEC.BAT, могут
быть перечислены:

  • REM —
    комментарии; неисполняемая команда,
    служит для пояснения действий;

  • PAUSE —
    прерывание выполнения командного файла
    до тех пор, пока не будет нажат любая
    клавиша;

  • CLS — очистка
    экрана;

  • ECHO — вывод
    сообщений на экран;

  • ECHO
    OFF — подавляет вывод на экран всех стоящих
    после нее команд;

  • ECHO
    ON — поддерживает вывод на экран всех
    стоящих последнее команд;

  • @ — запрет
    на индикацию одной команды, перед
    которой стоит этот символ;

  • VERIFY ON или
    OFF — установка (ON) /отключение (OFF) режима
    контрольного чтения при операциях
    записи файлов (если данный режим включен,
    то он позволяет выявлять возможные
    ошибки, но, естественно, замедляет
    работу);

  • PATH [Путь]
    — задание последовательности каталогов,
    в которых будут последовательно искаться
    исполняемые файлы, если пользователь
    при запуске не задает их полное имя;

  • PROMPT
    [параметры] — установка формата приглашения
    в командной строке DOS (по умолчанию
    используется текущее логическое
    устройство и символ >, например, С:>);

  • SET
    <Имя>=<3начение> — устанавливает
    имя и значение так называемой переменной
    системной среды.

К одной из главных
функций файла автозагрузки относится
запуск так называемых резидентных
программ
, которые после выполнения
должны остаться в памяти машины для
реализации тех или иных служебных
функций.

Очень часто из
AUTOEXEC.BAT запускаются:

  • антивирусные
    программы (например, VSAFE — резидентная
    команда слежения за появлением вирусов);

  • программы-оболочки
    (Norton Commander);

  • драйверы
    клавиатуры, принтера (для печати русских
    букв) и т. п.

Пример
возможного содержания файла AUTOEXEC.BAT
выглядит следующим образом:

REM
отключить вывод команд на экран

@ECHO
OFF

REM
задать переменную среды, сохраняющую
имя каталога

REM
для временных файлов

SET
ТЕМР=С:ТЕМР

RЕМ
задать
путь

PATH
C:DOS;C:;C;ARCH;C:NC;C:UTILNU

REM
задание номера кодовой страницы для
таблицы символов

MODE
CON CODEPAGE PR.EPARE=((866) C:DOSEQA.CPI)

CHCP
866

REM
загрузка драйвера русификации клавиатуры

LH
KEYB RU,,C:DOSKEYBOARD,SYS

REM
загрузка прочих драйверов: кэширования
жесткого диска, мыши, co-rom

LH
C:DOSSMARTDRV.EXE /X

LH
C:DOSMOUSE.COM

LH
C:COROMDRVMSCDEX /V /D:CD003 /M:10

REM
запустить
Norton commander

NC

3.5. Файл конфигурации config.Sys

Файл CONFIG.SYS предназначен
для настройки операционной системы на
конкретную конфигурацию аппаратуры
компьютера. Так же, как и AUTOEXEC.BAT, он
присутствует практически на любом
компьютере в главном каталоге на диске,
с которого производится загрузка
операционной системы.

Среди основных
отличительных особенностей CONFIG.SYS могут
быть названы следующие:

  • как
    правило, задаваемые в нем настройки
    действуют в течение всего сеанса работы
    (то есть могут быть изменены только
    после перезагрузки компьютера);

  • настройки
    CONFIG.SYS устанавливаются в автоматическом
    режиме перед выполнением AUTOEXEC.BAT.

Основное назначение
CONFIG.SYS состоит в организации загрузки
в оперативную память необходимых
драйверов для управления аппаратной
частью компьютера (подключение различных
видов памяти, клавиатуры, мыши, принтера).

Начиная с MS DOS версии
6.0, в CONFIG.SYS появилась возможность создания
описаний различных вариантов загрузки,
из которых пользователь имеет возможность
в режиме диалога выбирать нужный па
текущий сеанс работы.

CONFIG.SYS создается и
редактируется в любом текстовом
редакторе, при этом необходимо соблюдать
некоторые правила:

  • файл
    CONFIG.SYS состоит из специальных команд
    операционной системы MS DOS по настройке
    аппаратуры. Формат этих команд имеет
    особый вид: Имя команды=значение;

  • каждая
    команда располагается на отдельной
    строке (при вводе команд могут
    использоваться строчные и прописные
    буквы);

  • после
    ввода каждой команды нужно нажать
    клавишу <Enter>;

  • порядок
    записи команд DEVICE и DEVICEHIGH в файле
    CONFIG.SYS очень важен:

  • сначала
    устанавливаются драйверы, позволяющие
    работать с разными видами памяти,
    которые дополняют стандартную память
    объемом 640 Кбайт, а затем устанавливаются
    драйверы, использующие эти память;

  • после
    создания (редактирования) файла
    CONFIG.SYS необходимо перезагрузить
    операционную систему для установки
    новой конфигурации настройки.

Перечислим «часто
используемые» команды и устанавливаемые
драйверы в файле CONFIG.SYS:

  • BREAK=ON или
    OFF — установка/отмена режима возможности
    прерывания процесса выполнения программ
    по нажатию комбинации клавиш <Ctrl>+<Break>
    (или <Ctrl>+<C>);

  • BUFFERS=<число>
    — выделение объема оперативной памяти
    в соответствии с заданным в команде
    числом буферов (ячеек стандартной
    длины). Обычно рекомендуется использовать
    не менее 40 буферов;

  • DEVICE=<имя
    драйвера>[параметры] — подключение
    драйвера для управления каким-либо
    устройством;

  • DEVICEHIGH=<имя
    драйвера>[параметры] — загружает
    драйвер устройства в верхнюю память
    (UMB);

  • DOS=<параметры>
    — устанавливает режим использования
    области высокой памяти (НМА) и обеспечения
    доступа к блокам верхней памяти (UMB);

  • FILES=<число>
    — устанавливает максимальное число
    одновременно открытых файлов. Обычно
    не менее 20;

  • NUMLOCK=ON или
    OFF — устанавливает состояние клавиши
    NumLock;

  • РЕМ или
    ; — комментарии;

  • LASTDRIVE —
    установка, количества букв логических
    дисков;

Драйверы, входящие
в поставку операционной системы MS DOS:

  • ANSI.SYS —
    поддерживает эмуляцию терминала ANSI;

  • DISPLAY.SYS —
    поддерживает переключение кодовых
    страниц для монитора;

  • HIMEM.SYS —
    управляет использованием расширенной
    (Extended) памяти;

  • EMM386. ЕХЕ
    — организует расширенную (Extended) память
    и обеспечивает доступ к области верхней
    памяти на компьютерах с процессором
    386 и выше, которые имеют расширенную
    (Extended) память.

Пример
возможного содержания файла CONFIG.SYS:

DEVICE=C:D05HIMEM.SYS
/TESTMEM:OFF

DEVICE=C:DOSEMM386.EXE
RAM

COUNTRY=007,866
С:
DOSCOUNTRY.SYS

DEVICEHIGH=C:DOSDISPLAY.SYS
CON=(EGA,,1)

INSTAI_L=C:DOSNLSFUNC.EXE
C:DOSCOUNTRY.SYS

DEVICE=C:CDR.OMDRVCYBIDE.SYS
/D:CD003

BUFFERS=30

FILES=40

SWITCHES=/F

DOS=HIGH,
UMB

BREAK=ON

LASTDRIVE=M

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]

  • #
  • #
  • #
  • #
  • #
  • #
  • #
  • #
  • #
  • #
  • #

From Wikipedia, the free encyclopedia

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.

Usage[edit]

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,[1] but this can be worked around.[2]

The filename was also used by Disk Control Program [de] (DCP), an MS-DOS derivative by the former East-German VEB Robotron.[3]

In Korean versions of MS-DOS/PC DOS 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.[4]

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.[5] 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,[6] %2 the 2-digit terminal number (xx) (with 00 being the main console) and %3 the 1-digit session number (y).[7]

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.[8] 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[edit]

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.

@ECHO OFF
CLS
DATE
TIME
VER

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:

@ECHO OFF
PROMPT $P$G
PATH C:DOS;C:WINDOWS
SET TEMP=C:TEMP
SET BLASTER=A220 I7 D1 T2
LH SMARTDRV.EXE
LH DOSKEY
LH MOUSE.COM /Y

This configuration sets common environment variables, loads a disk cache, places common directories into the default PATH, and initializes the DOS mouse / 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.[9]

In MS-DOS 6.0 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.

@ECHO OFF
PROMPT $P$G
PATH C:DOS;C:WINDOWS
SET TEMP=C:TEMP
SET BLASTER=A220 I7 D1 T2
GOTO %CONFIG%
:WIN
LH SMARTDRV.EXE
LH MOUSE.COM /Y
WIN
GOTO 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.

Dual-booting DOS and Windows 9x[edit]

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.[10][11][12]

OS/2[edit]

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

Windows NT[edit]

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 a 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-formatted) or to keep the variables across a reinstall. This is an exotic usage today so the file usually remains empty. The Tweak UI applet from the Microsoft PowerToys collection allows to control this feature (Parse AUTOEXEC.BAT at logon).

See also[edit]

  • COMMAND.COM
  • IBMBIO.COM / IO.SYS
  • IBMDOS.COM / MSDOS.SYS
  • SHELL (CONFIG.SYS directive)
  • CONFIG.SYS
  • AUTORUN.INF

References[edit]

  1. ^ ««Subst» Command Does Not Work in Autoexec.bat File in Windows Millennium Edition». Revision 1.3. Microsoft. 2007-01-31. KB288997. Q288997. Archived from the original on 2011-05-24. Retrieved 2007-07-04.
  2. ^ Ashumov, V. (2017) [2007]. «Some features of MS-DOS 8.0». Archived from the original on 2010-10-22. Retrieved 2010-11-21.
  3. ^ Kurth, Rüdiger; Groß, Martin; Hunger, Henry (2016-11-29) [2007]. «Betriebssystem DCP». www.robotrontechnik.de (in German). Archived from the original on 2019-04-03. Retrieved 2019-04-28.
  4. ^ Paul, Matthias R. (2001-10-25). «System file settings». Newsgroup: comp.os.msdos.programmer. Archived from the original on 2017-09-10. Retrieved 2014-08-06. […] [W]hat’s KAUTOEXE.BAT? […] This is a special case in Korean MS-DOS/PC DOS 4.01+. It is still present in MS-DOS 7.10 (Windows 98SE, I’m not sure about 8.0 aka ME), but it vanished in PC DOS 7/2000. If the current country code is 82 […] and […] no /P:filename was specified *and* no default AUTOEXEC.BAT file was found, COMMAND.COM will instead execute a file named KAUTOEXE.BAT, if it exists. Presumably, this is used to ensure that the DBCS frontend drivers are loaded without properly set up CONFIG.SYS or AUTOEXEC.BAT files. […]
  5. ^ Brothers, Hardin; Rawson, Tom; Conn, Rex C.; Paul, Matthias R.; Dye, Charles E.; Georgiev, Luchezar I. (2002-02-27). 4DOS 8.00 online help.
  6. ^ Concurrent DOS Multiuser/Multitasking Operating System — Print Spooler User’s Guide (PDF). Digital Research. 1989-02-01. Archived (PDF) from the original on 2016-11-05. Retrieved 2014-08-12.
  7. ^ «FYI — Configuring CSPOOL». Novell. 1992-12-29. FYI.M.1901. Archived from the original on 2016-11-05. Retrieved 2014-08-12.
  8. ^ «INFO: Configuring Parsing of the AUTOEXEC.BAT» (1 ed.). Microsoft. 2007-03-20 [2002-06-11]. Q124551. Archived from the original on 2019-04-21. Retrieved 2017-09-10.
  9. ^ «Mouse Doesn’t Work with MS-DOS Shell». Microsoft. 2007 [1994]. KB96706. Q96706. Archived from the original on 2007-03-11. Retrieved 2006-10-15.
  10. ^ «Chapter 1: Introduction to DR-DOS». Caldera DR-DOS 7.02 User Guide. Caldera, Inc. 1998 [1993, 1997]. Archived from the original on 2016-11-05. Retrieved 2013-08-10.
  11. ^ Caldera DR-DOS 7.02 User Guide. Caldera, Inc. 1998 [1993, 1997]. Archived from the original on 2016-11-05. Retrieved 2013-08-10.
  12. ^ «FYI — Configuring LOADER.COM for Multiple Operating System Boots — Installing DR DOS on NEC DOS 3.3 Partitions». Novell. 1993-01-05. FYI.M.1909. Archived from the original on 2016-11-05. Retrieved 2014-08-12.

начальное пакетное задание, запускаемое процессором командной строки под DOS

AUTOEXEC.BAT— это системный файл, который изначально был в операционных системах типа DOS. Это обычный текстовый командный файл в корневом каталоге загрузочного устройства . Имя файла представляет собой аббревиатуру от «автоматического выполнения», которая описывает его функцию при автоматическом выполнении команд при запуске системы; имя файла было создано в ответ на ограничения 8.3 filename семейства файловых систем FAT.

Содержание

  • 1 Использование
  • 2 Пример
  • 3 DOS и Windows 9x с двойной загрузкой
  • 4 OS / 2
  • 5 Windows NT
  • 6 См. Также
  • 7 Ссылки

Использование

AUTOEXEC.BATчитается при запуске всеми версиями DOS, включая MS-DOS версии 7.x, которая используется в Windows 95 и Windows 98. Windows ME анализирует переменные среды только в рамках своих попыток уменьшить устаревшие зависимости, но это можно обойти.

Имя файла также использовалось программой управления дисками [de ] (DCP), производная от MS-DOS бывшего восточногерманского VEB Robotron.

В корейских версиях MS-DOS / PC DOS 4.01 и выше (кроме PC DOS 7 и 2000), если текущая код страны установлен на 82 (для Кореи), и не указано / P: filenameи не найдено значение по умолчанию AUTOEXEC.BAT, COMMAND.COM будет искать файл с именем KAUTOEXE.BATвместо этого, чтобы гарантировать, что драйверы внешнего интерфейса DBCS будут загружены даже без правильной настройки CONFIG.SYSи AUTOEXEC.BATfiles.

В DOS файл выполняется основной копией процессора командной строки (обычно COMMAND.COM) один раз. операционная система загрузилась, и обработка файла CONFIG.SYS завершена. Хотя DOS сама по себе не предоставляет средств для передачи параметров командного файла в COMMAND.COMдля обработки AUTOEXEC.BAT, альтернативный процессор командной строки 4DOS поддерживает директиву 4DOS.INIAutoExecParamsи параметр запуска // AutoExecParams =для определения таких параметров. В Concurrent DOS, Multiuser DOS и REAL / 32 три начальных параметра будут переданы либо в соответствующий STARTxxy.BAT(если существует) или общий файл запуска AUTOEXEC.BAT, % 1содержит номер виртуальной консоли, % 22-значный номер терминала (xx) ( 00 является главной консолью) и % 3однозначный номер сеанса (y).

Windows NT и ее потомки Windows XP и Windows Vista анализирует AUTOEXEC.BATпри входе пользователя в систему. Как и в Windows ME, все, кроме установки переменных среды, игнорируется. В отличие от CONFIG.SYS, команды в AUTOEXEC.BATможно вводить в интерактивном интерпретаторе командной строки . Это просто стандартные команды, которые оператор компьютера хочет выполнять автоматически при каждом запуске компьютера, и могут включать другие командные файлы.

AUTOEXEC.BATчаще всего используется для установки переменных среды, таких как клавиатура, звуковая карта, принтер и расположение временных файлов. Он также используется для запуска системных утилит низкого уровня, таких как следующие:

  • Антивирусные сканеры
  • Программное обеспечение для кэширования диска
  • Драйверы мыши
  • Драйверы клавиатуры
  • компакт-диск драйверы
  • Разное Другие драйверы

Пример

В ранних версиях DOS AUTOEXEC.BATпо умолчанию был очень простым. Команды DATE и TIME были необходимы еще на ранних машинах классов PC и XT. по умолчанию не было батарейного питания часы реального времени.

@ECHO OFF CLS DATE TIME VER

В средах за пределами США драйвер клавиатуры (например, KEYB FRдля французской клавиатуры) также был включен. Более поздние версии часто были значительно расширены за счет многочисленных сторонних драйверов устройств. Ниже представлена ​​базовая конфигурация DOS 5 типа AUTOEXEC.BAT, состоящая только из основных команд:

@ECHO OFF PROMPT $ P $ G ПУТЬ C:  DOS; C:  WINDOWS SET TEMP = C :  TEMP SET BLASTER = A220 I7 D1 T2 LH SMARTDRV.EXE LH DOSKEY LH MOUSE.COM / Y

Эта конфигурация устанавливает общие переменные среды, загружает кеш диска, помещает общие каталоги в значение по умолчанию PATH, и инициализирует драйверы мыши / клавиатуры DOS. Команда PROMPT устанавливает для подсказки значение «C: >» (когда рабочий каталог является корнем диска C) вместо простого «C>» (приглашение по умолчанию, указывающее только рабочий диск, а не каталог на нем).

Как правило, драйверы устройств загружались в CONFIG.SYS, а программы загружались в файл AUTOEXEC.BAT. Некоторые устройства, например мыши, могут быть загружены либо как драйвер устройства в CONFIG.SYS, либо как TSR в AUTOEXEC.BAT, в зависимости от производитель.

В MS-DOS 6.0 и выше меню загрузки DOS настраивается. Это может быть большим подспорьем для пользователей, которые хотят оптимизировать конфигурацию загрузки для различных программ, таких как игры DOS и Windows.

@ECHO OFF PROMPT $ P $ G ПУТЬ C:  DOS; C:  WINDOWS SET TEMP = C:  TEMP SET BLASTER = A220 I7 D1 T2 GOTO% CONFIG%: WIN LH SMARTDRV.EXE LH MOUSE.COM / Y WIN GOTO END: XMS LH SMARTDRV.EXE LH DOSKEY GOTO END: END

Строка GOTO %CONFIG% сообщает DOS о необходимости поиска пунктов меню, определенных в пределах КОНФИГ. СИСТЕМА. Затем эти профили называются здесь и настраиваются с использованием требуемых конкретных драйверов и утилит. В желаемом конце каждой конкретной конфигурации команда GOTOперенаправляет DOS в раздел : END. Строки после : ENDбудут использоваться всеми профилями.

DOS и Windows 9x с двойной загрузкой

При установке Windows 95 поверх уже существующей установки DOS / Windows, CONFIG.SYSи AUTOEXEC.BATпереименовываются в CONFIG.DOSи AUTOEXEC.DOS. Это предназначено для облегчения двойной загрузки между Windows 9x и DOS. При загрузке в DOS они временно переименовываются в CONFIG.SYSи AUTOEXEC.BAT. Резервные копии версий Windows 9x делаются в виде файлов .W40.

Windows 9x также устанавливает MSDOS.SYS , файл конфигурации, который не будет загружать Windows 95/98, если параметр BOOTGUI = 0установлен. загружен, и вместо этого на экране появится приглашение DOS (Windows все еще можно загрузить, вызвав команду WIN(файл WIN.COM). Этот файл содержит некоторые переключатели, которые определяют способ загрузки системы, один из которых контролирует, переходит ли система автоматически в Windows. Этот параметр «BootGUI» должен быть установлен на «0», чтобы загружаться в режиме командной строки DOS. При этом работа системы по существу становится работой пары DOS / Windows как и в более ранних версиях Windows. Windows можно запустить по желанию, набрав WINв командной строке DOS.

При установке Caldera DR-DOS 7.02 и выше версия Windows сохраняет имя AUTOEXEC.BAT, а файл, используемый DR-DOS COMMAND.COM, имеет имя AUTODOS7.BAT, упоминается параметром запуска /P:filename.extв SHEL L директива. Он также отличает файл CONFIG.SYS с помощью имени DCONFIG.SYS.

OS / 2

, эквивалентного AUTOEXEC. BATв OS / 2 — это файл OS / 2 STARTUP.CMD, однако подлинные сеансы DOS, загруженные под OS / 2, продолжают использовать AUTOEXEC.BAT.

Windows NT

В Windows NT и ее производных, Windows 2000, Windows Server 2003 и Windows XP, эквивалентный файл называется AUTOEXEC.NTи находится в каталоге % SystemRoot% system32. Файл не используется во время загрузки операционной системы; он выполняется при запуске среды MS-DOS, что происходит при загрузке приложения DOS.

Файл AUTOEXEC.BATчасто можно найти в Windows NT в корневом каталоге загрузочного диска. Windows учитывает только содержащиеся в ней операторы SET и PATH для определения переменных среды глобальных для все пользователи. Установка переменных среды через этот файл может быть интересной, если, например, MS-DOS также загружается с этого диска (для этого требуется, чтобы диск был отформатирован в FAT ) или для сохранения переменных при переустановке. Сегодня это экзотическое использование, поэтому файл обычно остается пустым. Апплет Tweak UI из коллекции Microsoft PowerToys позволяет управлять этой функцией (анализировать AUTOEXEC.BAT при входе в систему).

См. Также

  • COMMAND.COM
  • IBMBIO.COM / IO.SYS
  • IBMDOS.COM / MSDOS.SYS
  • ОБОЛОЧКА (Директива CONFIG.SYS)
  • CONFIG.SYS
  • AUTORUN.INF

Ссылки

Понравилась статья? Поделить с друзьями:
  • Autodesk fbx review windows 64 bit скачать
  • Autodesk desktop app как удалить windows 10
  • Autodesk 3ds max windows 7 скачать торрент
  • Autodesk 3ds max 2021 windows 7
  • Autodata установка на windows 10 x64