Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamshow me an autoexec.bat example
Here is a simple AUTOEXEC.BAT example:
@ECHO OFF
PROMPT $P$G
PATH C:\DOS;C:\WINDOWS;C:\UTILS
SET TEMP=C:\TEMP
SET TMP=C:\TEMP
DOSKEY
ECHO System startup complete.
Key points:
AUTOEXEC.BAT is a startup batch file used mainly in MS-DOS and Windows 95/98/ME.C:\AUTOEXEC.BAT.If you want a slightly more realistic legacy example, use this:
@ECHO OFF
REM Basic DOS startup configuration
PROMPT $P$G
PATH C:\DOS;C:\WINDOWS;C:\UTILS
SET TEMP=C:\TEMP
SET TMP=C:\TEMP
REM Sound Blaster settings for old DOS games
SET BLASTER=A220 I5 D1 H5 P330 T6
REM Load useful TSRs/utilities
LH DOSKEY
LH MOUSE.COM
LH SMARTDRV.EXE
ECHO Welcome to DOS.
AUTOEXEC.BAT is a batch script executed automatically after DOS has booted and after CONFIG.SYS has been processed. Historically, it was part of the standard startup flow for DOS-based systems.
@ECHO OFF
@ suppresses display of the ECHO OFF line itself.PROMPT $P$G
$P = current drive and path.$G = > character.C:\DOS>.PATH C:\DOS;C:\WINDOWS;C:\UTILS
SET TEMP=C:\TEMP
SET TMP=C:\TEMP
TEMP or TMP.SET BLASTER=A220 I5 D1 H5 P330 T6
A220 = I/O base addressI5 = IRQD1 = 8-bit DMAH5 = 16-bit DMAP330 = MIDI portT6 = card typeLH DOSKEY
DOSKEY into upper memory, if available.DOSKEY gives command history and macros.LH MOUSE.COM
LH SMARTDRV.EXE
LH mattersLH means Load High. It attempts to load the program into upper memory rather than conventional memory. This was important on DOS systems because many applications depended on preserving as much of the first 640 KB as possible.
For LH to work properly, memory support usually had to be configured earlier in CONFIG.SYS, commonly with settings such as:
DOS=HIGH,UMB
and a memory manager.
CONFIG.SYSA useful practical distinction is:
CONFIG.SYS
AUTOEXEC.BAT
For example, a CD-ROM driver often required:
.SYS driver in CONFIG.SYS, and thenMSCDEX.EXE in AUTOEXEC.BAT.Example:
LH C:\DOS\MSCDEX.EXE /D:MSCD001 /L:D
That /D:MSCD001 token must match the identifier used by the CD-ROM driver in CONFIG.SYS.
Although AUTOEXEC.BAT is historically important, it is now mainly relevant in these contexts:
For modern Windows systems based on the NT architecture, AUTOEXEC.BAT is not the normal startup mechanism. If someone is trying to auto-run programs today, the modern equivalents are typically:
So if your goal is a real retro DOS or Windows 9x setup, AUTOEXEC.BAT is correct. If your goal is Windows 10/11 startup automation, it is not the right tool.
If you only want the absolute minimum:
@ECHO OFF
PROMPT $P$G
PATH C:\DOS;C:\WINDOWS
@ECHO OFF
PROMPT $P$G
PATH C:\DOS;C:\GAMES;C:\SB16
SET TEMP=C:\TEMP
SET BLASTER=A220 I5 D1 H5 P330 T6
SET SOUND=C:\SB16
LH C:\DOS\DOSKEY
LH C:\SB16\CTMOUSE.EXE
LH C:\DOS\SMARTDRV.EXE
ECHO Ready for DOS games.
@ECHO OFF
PATH C:\DOS;C:\WINDOWS
SET TEMP=C:\TEMP
IF EXIST C:\MOUSE\MOUSE.COM LH C:\MOUSE\MOUSE.COM
IF EXIST C:\DOS\SMARTDRV.EXE LH C:\DOS\SMARTDRV.EXE
ECHO Startup finished.
This approach is safer because it avoids errors if a file is missing.
In standard DOS batch files, the safest comment style is:
REM This is a comment
You may also see:
:: This is often used as a comment
But REM is the most portable and correct choice. A leading semicolon is not the standard comment syntax for DOS batch files.
For this topic, the main concerns are practical rather than ethical, but a few points still matter:
SMARTDRV can improve performance, but configuration choices may affect shutdown safety on older systems.REM to disable lines during troubleshooting.@ECHO OFF
PROMPT $P$G
PATH C:\DOS;C:\WINDOWS
SET TEMP=C:\TEMP
REM Load utilities only if present
IF EXIST C:\DOS\DOSKEY.COM LH C:\DOS\DOSKEY.COM
IF EXIST C:\MOUSE\MOUSE.COM LH C:\MOUSE\MOUSE.COM
ECHO AUTOEXEC.BAT loaded successfully.
LH does not save memory, check CONFIG.SYS for upper-memory support.CONFIG.SYS.After booting, check:
PATH by typing:
PATHSETMEMAUTOEXEC.BAT is primarily a legacy DOS-era mechanism.SMARTDRV, MSCDEX, or MOUSE.COM, may not exist on your system unless they were installed.If you want to go deeper, the next useful topics are:
CONFIG.SYS and memory managementDOS=HIGH,UMBEMM386 and upper memory blocksMSCDEX and CD-ROM supportA good practical exercise is to build:
AUTOEXEC.BAT,DOSKEY,Yes—an AUTOEXEC.BAT example can be as simple as:
@ECHO OFF
PROMPT $P$G
PATH C:\DOS;C:\WINDOWS;C:\UTILS
SET TEMP=C:\TEMP
SET TMP=C:\TEMP
DOSKEY
The file is a DOS startup script used to set environment variables, configure the prompt, and load utilities. For more complete legacy systems, it often also loads mouse drivers, disk cache tools, and sound-card settings. On modern Windows, however, AUTOEXEC.BAT is mostly obsolete.
If you want, I can also show you:
AUTOEXEC.BAT,AUTOEXEC.BAT + CONFIG.SYS pair.