Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
AUTOEXEC.BAT
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Example== In early versions of DOS, <code>AUTOEXEC.BAT</code> was by default very simple. The <code>[[DATE (command)|DATE]]</code> and <code>[[TIME (command)|TIME]]</code> commands were necessary as early [[IBM Personal Computer|PC]] and [[IBM Personal Computer XT|XT]] class machines did not have a battery backed-up [[real-time clock]] as default. <syntaxhighlight lang="dosbatch"> @ECHO OFF CLS DATE TIME VER </syntaxhighlight> In non-US environments, the keyboard driver (like <code>KEYB FR</code> 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 <code>AUTOEXEC.BAT</code> configuration, consisting only of essential commands: <syntaxhighlight lang="dosbatch"> @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 </syntaxhighlight> This configuration sets common environment variables, loads a disk cache, places common directories into the default [[PATH (DOS command)|PATH]], and initializes the DOS mouse / keyboard drivers. The <code>[[PROMPT (DOS command)|PROMPT]]</code> command sets the [[prompt (computing)|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 <code>CONFIG.SYS</code>, and programs were loaded in the <code>AUTOEXEC.BAT</code> file. Some devices, such as mice, could be loaded either as a device driver in <code>CONFIG.SYS</code>, or as a [[Terminate-and-stay-resident program|TSR]] in <code>AUTOEXEC.BAT</code>, depending upon the manufacturer.<ref name="Microsoft_96706"/> 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. <syntaxhighlight lang="dosbatch"> @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 </syntaxhighlight> The <code>GOTO %CONFIG%</code> line informs DOS to look up menu entries that were defined within <code>CONFIG.SYS</code>. Then, these profiles are named here and configured with the desired specific drivers and utilities. At the desired end of each specific configuration, a <code>GOTO</code> command redirects DOS to the <code>:END</code> section. Lines after <code>:END</code> will be used by all profiles.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)