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-07-07 21:44
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] Can CONFIG.SYS include a selection function? View 1,643 Replies 9
Original Poster Posted 2005-04-28 00:00 ·  中国 上海 徐汇区 电信
银牌会员
★★★
永遠的DOS~~~
Credits 1,200
Posts 466
Joined 2005-02-01 00:00
21-year member
UID 35867
Gender Male
From 上海
Status Offline
Can CONFIG.SYS include a selection function similar to CHOICE in batch files? I'm not referring to the boot selection menu!
Thanks!
32位才是DOS未来的希望
个人网志:http://sololand.moe
Floor 2 Posted 2005-04-28 00:00 ·  中国 山西 运城 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re brglng:  Config.sys only takes effect when the system starts up. If you're not trying to make a boot selection menu, then what is your purpose in implementing a choice selection?
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 3 Posted 2005-04-29 00:00 ·  中国 上海 徐汇区 电信
银牌会员
★★★
永遠的DOS~~~
Credits 1,200
Posts 466
Joined 2005-02-01 00:00
21-year member
UID 35867
Gender Male
From 上海
Status Offline
If there is, then this function could be used at startup to let the user choose whether to load a certain program, how to load that program, and so on. This could give the user more freedom of choice than the boot menu.
32位才是DOS未来的希望
个人网志:http://sololand.moe
Floor 4 Posted 2005-04-29 00:00 ·  中国 山西 运城 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re brglng:
  The Config.sys menu selection can fully achieve similar functions. Also, config.sys is not a batch file, so it can't simply call an executable program. Below is the config.sys file I'm currently using; it implements startup control for the memory management programs himem.sys and emm386.exe.

submenu=memtest, Memory Test Mode
menuitem=clear, Clear Booting
menuitem=cdrom, Load CD-ROM
menuitem=normal, Normal Booting
menucolor=14,1
menudefault=normal,5

menuitem=nohimem, Booting without HIMEM.SYS
menuitem=no386, Booting without EMM386.EXE
menuitem=noems, Booting with EMM386.EXE /NOEMS
menuitem=ram, Booting with EMM386.EXE /RAM

DOS=HIGH,UMB

DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF
DOS=HIGH,UMB

DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF
DEVICE=C:\DOS\EMM386.EXE NOEMS
DOS=HIGH,UMB

DEVICE=C:\DOS\HIMEM.SYS /TESTMEM:OFF
DEVICE=C:\DOS\EMM386.EXE RAM
DOS=HIGH,UMB



※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 5 Posted 2005-04-29 00:00 ·  中国 上海 徐汇区 电信
银牌会员
★★★
永遠的DOS~~~
Credits 1,200
Posts 466
Joined 2005-02-01 00:00
21-year member
UID 35867
Gender Male
From 上海
Status Offline
Thank you very much.
Only now did I realize that can also have submenu. This way, by going down through submenus one by one, selective booting can be achieved! Thanks so much!
Sorry, but let me ask: can one have multiple submenu entries? Can submenu itself also have submenu? Thanks.
32位才是DOS未来的希望
个人网志:http://sololand.moe
Floor 6 Posted 2005-04-29 00:00 ·  中国 上海 徐汇区 电信
银牌会员
★★★
永遠的DOS~~~
Credits 1,200
Posts 466
Joined 2005-02-01 00:00
21-year member
UID 35867
Gender Male
From 上海
Status Offline
For example, if I want the system to load programs according to the user's choice after the user selects a menu item, and then show the next-level menu, how should that be done?
32位才是DOS未来的希望
个人网志:http://sololand.moe
Floor 7 Posted 2005-04-29 00:00 ·  中国 山西 临汾 中移铁通
元老会员
★★★★
Batchinger
Credits 4,432
Posts 1,512
Joined 2002-10-18 00:00
23-year member
UID 19
Gender Male
Status Offline
Re brglng:  There can be multiple and multi-level submenus (submenu) in config.sys.  But there is one limitation: all menus are single-choice rather than multiple-choice. That is to say, if you want to load multiple programs through menu selection, you must first enumerate all possible combinations of choices. If there are 4 programs to choose from, there may be 16 combinations, which means 16 menu items are needed. Of course, these 16 menu items can be divided into multiple submenus, and some very rarely used combinations can also be omitted to reduce the user's selection burden.  However, when there are too many drivers that need to be chosen, this method is obviously no good. At this point, you can use config.sys's single-line selection function. It uses a special character, namely the question mark. The detailed information is as follows:
The CONFIG.SYS file can also include the following special characters:

; Indicates that the line is a comment line and will not be executed. This character should be placed at the
beginning of the line.
(You can also use the REM command to insert comments).

? Specifies that before MS-DOS executes the current command, it first asks the user to confirm. ? should be placed before the equal sign. For example, if
the command DOS=HIGH is changed to DOS?=HIGH, then confirmation will be required before that command is executed.
If confirmation is needed before executing the command DEVICEHIGH /L:1,7280=MYFILE.SYS, then this command can be
changed to DEVICEHIGH? /L:1,7280=MYFILE.SYS.
※ Batchinger 致 Bat Fans:请访问 批处理编程的异类 ,欢迎交流与共享批处理编程心得!
Floor 8 Posted 2005-04-30 00:00 ·  中国 河北 廊坊 电信
中级用户
★★
Javaing...
Credits 483
Posts 88
Joined 2003-10-19 00:00
22-year member
UID 11495
Gender Male
Status Offline
I suggest the OP read more basic DOS materials in everyday study.
@_@ 行动就有收获!

QQ:170759292
Floor 9 Posted 2005-04-30 00:00 ·  中国 上海 徐汇区 电信
银牌会员
★★★
永遠的DOS~~~
Credits 1,200
Posts 466
Joined 2005-02-01 00:00
21-year member
UID 35867
Gender Male
From 上海
Status Offline
Thanks. Originally I didn't understand DOS very well. After finding "New DOS Era," I became especially interested in DOS. Now I can even make boot disks, and they're not bad. Right now I just want to make a boot disk with very strong selectivity, so that at almost every step during startup the user can choose for himself. If I use "?", then the prompt messages asking for choices during startup definitely won't be what I want, right? It would surely say things like "whether to load VIDE-CDD.SYS" or whether to execute some command. What if the user can't understand that?
32位才是DOS未来的希望
个人网志:http://sololand.moe
Floor 10 Posted 2005-04-30 00:00 ·  中国 上海 徐汇区 电信
银牌会员
★★★
永遠的DOS~~~
Credits 1,200
Posts 466
Joined 2005-02-01 00:00
21-year member
UID 35867
Gender Male
From 上海
Status Offline
Haha, I just remembered that I can use DEVICE=ECHO.SYS to display text first, and then execute the statement with "?".
Thank you all so much!
32位才是DOS未来的希望
个人网志:http://sololand.moe
Forum Jump: