China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-08-01 23:14
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » Automatically start programs under DOS View 1,853 Replies 5
Original Poster Posted 2006-07-05 17:30 ·  中国 广东 广州 天河区 电信
新手上路
Credits 10
Posts 3
Joined 2006-07-05 16:49
20-year member
UID 58067
Status Offline
Operating system environment: DOS under Win98, Win98

There is a DOS program that needs to run automatically when starting pure DOS (press F8 when starting Win98 and select Command Prompt Only).
But when starting Win98 normally (select Normal), it does not run. How to write in autoexec.bat.

If it cannot be realized in autoexec.bat, how to program it with Turbo Pascal 7.0.
Floor 2 Posted 2006-07-05 18:39 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
Been away from 98 for years and a bit rusty, give a hint on configuring the config.sys multi-choice menu and the method to replace MSDOS.SYS

[ Last edited by fastslz on 2006-7-5 at 18:56 ]
Floor 3 Posted 2006-07-06 11:00 ·  中国 广东 广州 天河区 电信
新手上路
Credits 10
Posts 3
Joined 2006-07-05 16:49
20-year member
UID 58067
Status Offline
Hehe, thanks for the reply, but my program is for users to use, I can't replace the user's msdos.sys
Floor 4 Posted 2006-07-06 23:24 ·  中国 上海 松江区 电信
铂金会员
★★★★
DOS一根葱
Credits 5,493
Posts 2,315
Joined 2006-05-01 10:41
20-year member
UID 54766
Gender Male
From 上海
Status Offline
Originally posted by ifiles at 2006-7-6 11:00:
Hehe, thanks for the reply, but my program is for users, I can't replace the user's msdos.sys




  1. Sweat.....
  2. 1: If you can't touch the user's files at all, there's no other way except F8!
  3. 2: Excluding 1... The following config.sys and autoexec.bat are untested and for reference only

  4. config.sys

  5. MENUITEM=98, Boot Windows 98
  6. MENUITEM=DOS, Boot MS-DOS
  7. MENUDEFAULT=98,10

  8. DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF /Q
  9. DEVICE=C:\DOS\EMM386.EXE NOEMS
  10. SHELL=C:\COMMAND.COM /E:1024 /P /F
  11. DOS=HIGH,UMB
  12. FCBSHIGH=4,0
  13. FILESHIGH=30
  14. BUFFERSHIGH=20,0
  15. STACKSHIGH=9,256




  16. autoexec.bat
  17. @ECHO OFF
  18. PROMPT $P$G
  19. PATH=C:\;C:\WINDOWS
  20. SET EXPAND=YES
  21. SET DIRCMD=/OGN /4
  22. IF "%CONFIG%"=="98" GOTO 98
  23. IF "%CONFIG%"=="DOS" GOTO DOS
  24. :98
  25. ATTRIB -S -H -R C:\COMMAND.COM
  26. ATTRIB -S -H -R C:\IO.SYS
  27. ATTRIB -S -H -R C:\MSDOS.SYS
  28. COPY /Y C:\98\COMMAND.COM C:\
  29. COPY /Y C:\98\IO.SYS C:\
  30. COPY /Y C:\98\MSDOS.SYS C:\
  31. ATTRIB +S +H +R C:\COMMAND.COM
  32. ATTRIB +S +H +R C:\IO.SYS
  33. ATTRIB +S +H +R C:\MSDOS.SYS
  34. WIN
  35. GOTO END
  36. :DOS
  37. ATTRIB -S -H -R C:\COMMAND.COM
  38. ATTRIB -S -H -R C:\IO.SYS
  39. ATTRIB -S -H -R C:\MSDOS.SYS
  40. COPY /Y C:\DOS\COMMAND.COM C:\
  41. COPY /Y C:\DOS\IO.SYS C:\
  42. COPY /Y C:\DOS\MSDOS.SYS C:\
  43. ATTRIB +S +H +R C:\COMMAND.COM
  44. ATTRIB +S +H +R C:\IO.SYS
  45. ATTRIB +S +H +R C:\MSDOS.SYS
  46. GOTO END
  47. :END
DOS一跟葱 2006-07-06 23:15
Floor 5 Posted 2006-07-07 08:40 ·  中国 四川 广元 电信
初级用户
Credits 55
Posts 22
Joined 2006-05-26 19:42
20-year member
UID 56051
Status Offline
To achieve this goal, a multi-boot menu must be created.

Hehe... Here are the AUTOEXEC.BAT and CONFIG.SYS files from my old computer for your reference:

AUTOEXEC.BAT

@ECHO OFF
PROMPT $P$G
PATH C:\WINDOWS;C:\WINDOWS\COMMAND

SET BLASTER=A220 I5 D1 : Sound card environment variable
SET SOUND16=D:\TOOLS : Sound card driver directory
D:\TOOLS\SNDINIT /B >NUL : Sound card driver
SET TEMP=C:\TEMP
SET TMP=C:\TEMP
D:\TOOLS\MOD CON DELAY=1 RATE=32 : Keyboard acceleration, can be REM if not needed
GOTO %CONFIG%

:WIN98 : WIN98 startup item
C:\WINDOWS\WIN.COM
GOTO END

:DOS : Pure DOS startup item
LH D:\TOOLS\SMARTDRV.EXE
GOTO END

:CD : Load CD-ROM when playing games
D:\TOOLS\MSCDEX.EXE /D:MSCD000 /L:E
LH D:\TOOLS\SMARTDRV.EXE
GOTO END

:END


CONFIG.SYS


MENUITEM=WIN98,WINDOWS 95
MENUITEM=DOS,MS-DOS7.10
MENUITEM=CD,GAME
MENUCOLOR=15,1
MENUDEFAULT=WIN98,5


DEVICE=C:\WINDOWS\HIMEM.SYS
DEVICE=C:\WINDOWS\EMM386.EXE RAM I=B000-B7FF
DOS=UMB,HIGH
NUMLOCK=OFF
BREAK=ON


DEVICE=C:\WINDOWS\HIMEM.SYS
DEVICE=C:\WINDOWS\EMM386.EXE RAM I=B000-B7FF
DOS=UMB,HIGH
NUMLOCK=OFF
BREAK=ON


DEVICE=C:\WINDOWS\HIMEM.SYS
DEVICE=C:\WINDOWS\EMM386.EXE RAM I=B000-B7FF
DOS=UMB,HIGH
device=d:\tools\CDR58201.SYS /D:mscd000
NUMLOCK=OFF
BREAK=ON


[ Last edited by MySOFT2006 on 2006-7-7 at 12:59 ]
Floor 6 Posted 2006-07-07 09:11 ·  中国 广东 广州 天河区 电信
新手上路
Credits 10
Posts 3
Joined 2006-07-05 16:49
20-year member
UID 58067
Status Offline
Thanks a lot. It seems that we can only use this method.
Forum Jump: