|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 16 楼』:
使用 LLM 解释/回答一下
虚拟机测试的,实机会不一样?这就用实DOS看看。
报告测试结果,实机与虚拟机结果完全一样。用虚拟机主要是截图方便。
Last edited by lianjiang2004 on 2006-10-30 at 07:05 AM ]
Tested on a virtual machine, would it be different on a real machine? Let's use a real DOS to see.
Report the test result, the result on the real machine is completely the same as that on the virtual machine. Using the virtual machine is mainly for convenient screenshotting.
Last edited by lianjiang2004 on 2006-10-30 at 07:05 AM ]
|
|
2006-10-30 06:52 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 17 楼』:
使用 LLM 解释/回答一下
不是要你测试什么虚拟机或者是DOS实模式,是DOS系统不支持" ( "和" ) "还有" & "等符号的执行,所以要用 if 和 goto 等语句变通..
It's not about you testing any virtual machine or DOS real mode. It's that the DOS system doesn't support the execution of symbols like "(" and ")" and "&", so you need to use statements like if and goto for workarounds..
|
|
2006-10-30 07:15 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 18 楼』:
使用 LLM 解释/回答一下
本人对DOS只知道点皮毛,平时一般都是修改别人的autoexec.bat等,能否给看看我的问题,DOS下用该如何写?
不好意思,开始没把问题说清楚。
Last edited by lianjiang2004 on 2006-10-30 at 07:33 AM ]
I only know a little bit about DOS, usually I just modify others' autoexec.bat and so on. Can you take a look at my problem? How to write it under DOS?
I'm sorry, I didn't make the problem clear at the beginning.
Last edited by lianjiang2004 on 2006-10-30 at 07:33 AM ]
|
|
2006-10-30 07:29 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 19 楼』:
使用 LLM 解释/回答一下
先说明运行环境很重要~~
First, it's important to state that the operating environment is very important~~
|

第一高手 第二高手
我的小站
 |
|
2006-10-30 07:45 |
|
|
mountvol
初级用户
 
积分 186
发帖 117
注册 2006-8-14
状态 离线
|
『第 20 楼』:
使用 LLM 解释/回答一下
for %%i in (o n m l k j i h g f e d c) do if exist %%i:\aaa.txt set drive=%%i
```
for %%i in (o n m l k j i h g f e d c) do if exist %%i:\aaa.txt set drive=%%i
```
|
|
2006-10-30 07:57 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 21 楼』:
使用 LLM 解释/回答一下
DOS启动盘里用的。谢谢。
Used in DOS boot disks. Thank you.
|
|
2006-10-30 07:58 |
|
|
hhl
初级用户
 
积分 35
发帖 14
注册 2006-10-16
状态 离线
|
『第 22 楼』:
使用 LLM 解释/回答一下
namejm斑竹,你上面写的代码,有点疑惑,似乎只能找到第一个含有aaa.txt的分区,不知对不对。
Moderator namejm, I have some doubts about the code you wrote above. It seems that it can only find the first partition containing aaa.txt. Is that correct?
|
|
2006-10-30 08:05 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 23 楼』:
使用 LLM 解释/回答一下
@echo off
for %%a in (c d e f g h i j k l m n o) do if exist %%a:\aaa.txt set 输出盘符变量=%%a
for %%b in (c d e f g h i j k l m n o) do if "%输出盘符变量%"=="%%b" echo aaa.txt位于 %%b:
@echo off
for %%a in (c d e f g h i j k l m n o) do if exist %%a:\aaa.txt set 输出盘符变量=%%a
for %%b in (c d e f g h i j k l m n o) do if "%输出盘符变量%"=="%%b" echo aaa.txt位于 %%b:
|

第一高手 第二高手
我的小站
 |
|
2006-10-30 08:08 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 24 楼』:
使用 LLM 解释/回答一下
Originally posted by fastslz at 2006-10-30 08:08:
@echo off
for %%a in (c d e f g h i j k l m n o) do if exist %%a:\aaa.txt set 输出盘符变量=%%a
for %%b in (c d e f g h i j k l m n o) do if "%输出盘符变量%"=="%%b" ...
请教:
for %%a这句已经把aaa.txt存在的盘符给了变量,那for %%b这句的作用是什么?不要行吗?
### 这里可能原文本就是这样,按照要求直接呈现翻译后的内容(因为原内容主要是代码相关,这里就是保留原样呈现)
@echo off
for %%a in (c d e f g h i j k l m n o) do if exist %%a:\aaa.txt set 输出盘符变量=%%a
for %%b in (c d e f g h i j k l m n o) do if "%输出盘符变量%"=="%%b" ...
Ask: The for %%a sentence has given the variable the drive letter where aaa.txt exists. What is the function of the for %%b sentence? Can it be omitted?
|
|
2006-10-30 09:04 |
|
|
fastslz
铂金会员
       DOS一根葱
积分 5493
发帖 2315
注册 2006-5-1 来自 上海
状态 离线
|
『第 25 楼』:
使用 LLM 解释/回答一下
晕晕~的全部不要都行^_^
第2句for是满足你(存在的话,就输出盘符给以变量,并执行其他任务,否则继续查找直到O盘结束。)的要求,你可以将echo aaa.txt位于 %%b:改成goto %%b: 或edit %%b:\aaa.txt
Dizzy~ All the first sentences can be removed. ^_^
The second sentence: for is to meet your requirements (if it exists, output the drive letter to a variable and perform other tasks; otherwise, continue searching until drive O ends.) You can change echo aaa.txt located in %%b: to goto %%b: or edit %%b:\aaa.txt
|

第一高手 第二高手
我的小站
 |
|
2006-10-30 09:23 |
|
|
lianjiang2004
金牌会员
     
积分 3946
发帖 1884
注册 2006-1-20
状态 离线
|
『第 26 楼』:
使用 LLM 解释/回答一下
谢谢,好像明白了一些。
感谢各位的热情解答!!!
Thanks, it seems I understand something.
Thanks to everyone's enthusiastic answers!!!
|
|
2006-10-30 10:08 |
|
|
namejm
荣誉版主
       batch fan
积分 5226
发帖 1737
注册 2006-3-10 来自 成都
状态 离线
|
『第 27 楼』:
使用 LLM 解释/回答一下
Originally posted by hhl at 2006-10-30 08:05:
namejm斑竹,你上面写的代码,有点疑惑,似乎只能找到第一个含有aaa.txt的分区,不知对不对。
完全正确,因为楼主说只要找到了就显示并执行其他的动作,所以就写成那样了。如果要找到含有aaa.txt的所有分区其实也不难。
Originally posted by hhl at 2006-10-30 08:05:
Moderator namejm, I have some doubts about the code you wrote above. It seems that it can only find the first partition containing aaa.txt. Is that right?
Completely correct. Because the original poster said that as long as it is found, it will display and perform other actions, so it was written like that. If you want to find all partitions containing aaa.txt, it is actually not difficult.
|

尺有所短,寸有所长,学好CMD没商量。
考虑问题复杂化,解决问题简洁化。 |
|
2006-10-30 11:20 |
|