![]() |
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-08-08 20:15 |
47,811 topics / 349,895 posts / today 0 new / 48,253 members |
| DOS批处理 & 脚本技术(批处理室) » [Seeking Improvement] A New Method to Judge the CD-ROM Drive |
| Printable Version 2,800 / 17 |
| Floor16 quya | Posted 2008-05-28 22:13 |
| 高级用户 Posts 172 Credits 558 From 江苏 | |
|
There are still some questions to ask.
It is said that the fsutil command can only be restricted to be used by administrators, and only the XP Pro version can be used. The dir [drive] >nul 2>nul is too useful. But do we have to go back to the old way of for %%i in (C: D: E: F: G: H: I: J: K: L: M: N: O: P: Q: R: S: T: U: V: W: X: Y: Z:) do if exist %%i\WIN51 set CDROM=%%i? There is a defect in this old way, that is, it is necessary to judge a specific file. Is there a better way? |
|
| Floor17 quya | Posted 2008-05-28 23:08 |
| 高级用户 Posts 172 Credits 558 From 江苏 | |
|
According to the idea of 26933062, I made one
Explanation: findcd.exe is a third-party program, only 3.11K If this program findcd is added with the /s parameter, it will list multiple CDs, and the result is as in the following example: CDROM=2 CDROM1=H: CDROM2=I: Under old DOS, these variables will be assigned, saving a lot of trouble, but under XP, it can't! And it will change the codepage, so I added a line CHCP 936. The actual running result is as follows: Why is there an extra line, it seems that skip=1 is useless, I don't understand. Why can't I insert an attachment? I want to attach the program of findcd. Download here [ Last edited by quya on 2008-5-28 at 11:29 PM ] |
|
| Floor18 WANKOILZ | Posted 2008-05-29 19:34 |
| 初级用户 Posts 89 Credits 198 From 重庆 | |
|
%var1%^|more
%var2% %%a: This trick in floor 11 looks very neat! [ Last edited by WANKOILZ on 2008-5-29 at 07:38 PM ] |
|
| Prev 1 2 |
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |