中国DOS联盟论坛

China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --
Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
Guest | Log in | Register | Members | Search | China DOS Union
中国DOS联盟论坛
The time now is 2026-09-23 14:10
47,812 topics / 349,917 posts / today 0 new / 48,273 members
DOS批处理 & 脚本技术(批处理室) » [Help] Can CONFIG.SYS include a selection function?
Printable Version  1,793 / 9
Floor1 brglng Posted 2005-04-28 00:00
银牌会员 Posts 466 Credits 1,200 From 上海
Can CONFIG.SYS include a selection function similar to CHOICE in batch files? I'm not referring to the boot selection menu!
Thanks!
Floor2 willsort Posted 2005-04-28 00:00
元老会员 Posts 1,512 Credits 4,432
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?
Floor3 brglng Posted 2005-04-29 00:00
银牌会员 Posts 466 Credits 1,200 From 上海
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.
Floor4 willsort Posted 2005-04-29 00:00
元老会员 Posts 1,512 Credits 4,432
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.

Floor5 brglng Posted 2005-04-29 00:00
银牌会员 Posts 466 Credits 1,200 From 上海
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.
Floor6 brglng Posted 2005-04-29 00:00
银牌会员 Posts 466 Credits 1,200 From 上海
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?
Floor7 willsort Posted 2005-04-29 00:00
元老会员 Posts 1,512 Credits 4,432
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.
Floor8 SNOWOLF Posted 2005-04-30 00:00
中级用户 Posts 88 Credits 483
I suggest the OP read more basic DOS materials in everyday study.
Floor9 brglng Posted 2005-04-30 00:00
银牌会员 Posts 466 Credits 1,200 From 上海
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?
Floor10 brglng Posted 2005-04-30 00:00
银牌会员 Posts 466 Credits 1,200 From 上海
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!
[ Contact the Union admin team - 中国DOS联盟 - Standard version ]
Sponsored by ifanr Inc | © 2001–2023