Re gmy:
你的程序的改进重点不在于简化语句,而在于容错处理,因为从 C: 到 W: 很有可能碰到未放置光盘的光驱,未连接网络的网络盘以及一些特殊的USB存储设备等等,在这里使用 if exist 探测 boot.iini 的存在会遇到很多意想不到的问题。
第三方命令 dready 的出现,解决了不少问题,本论坛已出现不少的利用它来循环检测驱动器序列的程序,可以多搜索以下过去的帖子。但它不可能解决所有问题,具体讨论参见。
驱动器轮询遍历程序索引
9637-12-walu-驱动器轮询遍历-1
http://www.cn-dos.net/forum/viewthread.php?tid=9637
11963-9-walu-驱动器轮询遍历-2
http://www.cn-dos.net/forum/viewthread.php?tid=11963
14620-9-ramjet-驱动器轮询遍历-3
http://www.cn-dos.net/forum/viewthread.php?tid=14620
14667-9-lin8197-驱动器轮询遍历-4
http://www.cn-dos.net/forum/viewthread.php?tid=14667
15599-9-GOTOmsdos-驱动器轮询遍历-5(链接Bat)
http://www.cn-dos.net/forum/viewthread.php?tid=15599
关于 HDKP 的几点技术探讨
http://www.cn-dos.net/forum/viewthread.php?tid=12892#pid95281
Re gmy:
The key improvement of your program is not in simplifying the statements, but in fault tolerance processing, because when going from C: to W:, it is very likely to encounter optical drives with no discs placed, network drives not connected to the network, and some special USB storage devices, etc. Using if exist to detect the existence of boot.iini here will encounter many unexpected problems.
The appearance of the third-party command dready has solved many problems. There have been many programs using it to loop through detecting drive sequences in this forum. You can search more for past posts . But it cannot solve all problems. For specific discussions, see .
Drive Polling Traversal Program Index
9637-12-walu-Drive Polling Traversal-1
http://www.cn-dos.net/forum/viewthread.php?tid=9637
11963-9-walu-Drive Polling Traversal-2
http://www.cn-dos.net/forum/viewthread.php?tid=11963
14620-9-ramjet-Drive Polling Traversal-3
http://www.cn-dos.net/forum/viewthread.php?tid=14620
14667-9-lin8197-Drive Polling Traversal-4
http://www.cn-dos.net/forum/viewthread.php?tid=14667
15599-9-GOTOmsdos-Drive Polling Traversal-5 (Link Bat)
http://www.cn-dos.net/forum/viewthread.php?tid=15599
Some Technical Discussions on HDKP
http://www.cn-dos.net/forum/viewthread.php?tid=12892#pid95281