![]() |
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-13 06:45 |
47,811 topics / 349,897 posts / today 0 new / 48,256 members |
| DOS学习入门 & 精彩文章 (教学室) » Help with this batch file problem |
| Printable Version 572 / 1 |
| Floor1 walu | Posted 2004-02-15 00:00 |
| 高级用户 Posts 201 Credits 916 | |
|
Boot the computer with a floppy disk. The contents of AUTOEXEC.BAT on the floppy are as follows:
for %%1 in (d e f g h i j k l m n o p q r s t u v w) do if exist %%1:\AUTOEXEC.BAT %%1: What I mean is, if AUTOEXEC.BAT exists in some partition, then switch to that partition's drive letter. For example, if AUTOEXEC.BAT exists on drive D, then after booting from the floppy it should switch to D: But the way I wrote it above is wrong. Please help point out the mistake, thanks! |
|
| Floor2 willsort | Posted 2004-02-16 00:00 |
| 元老会员 Posts 1,512 Credits 4,432 | |
|
Re walu:
This is a rather strange problem. The reason is that you wrote %%1: and for on two separate lines; just put them on one line and it will be fine. Was it your own oversight? Or did you do it intentionally? |
|
|
[ Contact the Union admin team -
中国DOS联盟 -
Standard version ] Sponsored by ifanr Inc | © 2001–2023 |