|
ivanisme
初级用户
 
积分 30
发帖 13
注册 2007-3-14
状态 离线
|
『楼 主』:
如果实现运行A.bat调用B.bat完成后再运行C.bat
使用 LLM 解释/回答一下
现有三个bat文件,A、B、C。
A的里面有运行B C的功能。
想实现下面的功能:
运行A.bat Call B.bat B.bat运行成功 再运行 C.bat
总之就是 按照 A、B、C 的顺序运行,不能B.bat没运行完,C.bat就运行了
PS:DOS里有睡眠的概念吗?
Last edited by ivanisme on 2007-3-20 at 09:16 AM ]
There are three batch files, A, B, and C.
A has the function of running B and C.
Want to realize the following function:
Run A.bat, Call B.bat. If B.bat runs successfully, then run C.bat.
In short, run in the order of A, B, C. C.bat should not run before B.bat is finished.
PS: Is there a concept of sleep in DOS?
Last edited by ivanisme on 2007-3-20 at 09:16 AM ]
|
|
2007-3-20 05:19 |
|
|
Kinglion
铂金会员
       痴迷DOS者
积分 5798
发帖 1924
注册 2003-6-20 来自 金獅電腦軟體工作室
状态 离线
|
『第 2 楼』:
使用 LLM 解释/回答一下
知道也不回答你,你注册的时候没有好好看看论坛新手必读那个帖子吗?
I know but won't answer you. Didn't you read the "Newcomer Must-Read" post on the forum carefully when you registered?
|

熟能生巧,巧能生精,一艺不精,终生无成,精亦求精,始有所成,臻于完美,永无止境!
金狮電腦軟體工作室愿竭诚为您服务!
QQ群:8393170(定期清理不发言者)
个人网站:http://www.520269.cn
电子邮件:doujiehui@vip.qq.com
微信公众号: doujiehui
|
|
2007-3-20 06:02 |
|
|
ivanisme
初级用户
 
积分 30
发帖 13
注册 2007-3-14
状态 离线
|
|
2007-3-20 06:15 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 4 楼』:
使用 LLM 解释/回答一下
A.bat里面的代码就一句:call B.bat&&call C.bat;
兄说的睡眠是延时的意思么?
The code in A.bat is just one line: call B.bat&&call C.bat;
What you mean by sleep is the meaning of delay?
|
|
2007-3-20 06:17 |
|
|
Kinglion
铂金会员
       痴迷DOS者
积分 5798
发帖 1924
注册 2003-6-20 来自 金獅電腦軟體工作室
状态 离线
|
『第 5 楼』:
建议楼主将主题改为以下:
使用 LLM 解释/回答一下
如果实现运行A.bat调用B.bat完成后再运行C.bat
If you want to implement that running A.bat calls B.bat and then runs C.bat after B.bat is completed.
|

熟能生巧,巧能生精,一艺不精,终生无成,精亦求精,始有所成,臻于完美,永无止境!
金狮電腦軟體工作室愿竭诚为您服务!
QQ群:8393170(定期清理不发言者)
个人网站:http://www.520269.cn
电子邮件:doujiehui@vip.qq.com
微信公众号: doujiehui
|
|
2007-3-20 06:26 |
|
|
ivanisme
初级用户
 
积分 30
发帖 13
注册 2007-3-14
状态 离线
|
『第 6 楼』:
使用 LLM 解释/回答一下
Originally posted by lxmxn at 2007-3-19 05:17 PM:
A.bat里面的代码就一句:call B.bat&&call C.bat;
兄说的睡眠是延时的意思么?
如果B.bat里含有调用exe就不行了呀
睡眠是延时就是线程Sleep
Originally posted by lxmxn at 2007-3-19 05:17 PM:
There is only one line of code in A.bat: call B.bat&&call C.bat;
Brother, do you mean that sleeping is delaying?
If there are calls to exe in B.bat, it won't work.
Sleeping means delaying, which is thread Sleep
|
|
2007-3-20 07:38 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 7 楼』:
使用 LLM 解释/回答一下
Originally posted by ivanisme at 2007-3-19 18:38:
如果B.bat里含有调用exe就不行了呀
睡眠是延时就是线程Sleep
含有exe文件可以用start命令来调用;start /min "" exefile.exe
哦,这个可以用ping命令来简介实现延时;ping 127.1 5 >nul 2>nul,这样可以延时大约4秒钟。
Originally posted by ivanisme at 2007-3-19 18:38:
If there are calls to EXE files in B.bat, it won't work. Sleep is about delaying, which is like thread Sleep.
If there are EXE files, you can use the start command to call them; start /min "" exefile.exe
Oh, this can be indirectly achieved by using the ping command to delay; ping 127.1 5 >nul 2>nul, which can delay for about 4 seconds.
|
|
2007-3-20 07:49 |
|
|
ivanisme
初级用户
 
积分 30
发帖 13
注册 2007-3-14
状态 离线
|
『第 8 楼』:
使用 LLM 解释/回答一下
现在的状况是B.bat里有调用exe的东西。
C.bat是调用其它的bat文件
A.bat仍然调用 B.bat、C.bat (要B执行完,C再执行)
lxmxn老兄有什么好的方法呀?
The current situation is that there is something that calls an exe in B.bat. C.bat calls other bat files. A.bat still calls B.bat and C.bat (C should be executed after B is completed). Brother lxmxn, do you have any good methods?
|
|
2007-3-20 21:48 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 9 楼』:
使用 LLM 解释/回答一下
几个批处理可以干的事情,用一个批处理也可以完成,你就说说你最终是要达到什么目的吧。
Several batch processes can do things, and one batch process can also be completed. Just tell me what purpose you ultimately want to achieve.
|
|
2007-3-20 23:03 |
|
|
ivanisme
初级用户
 
积分 30
发帖 13
注册 2007-3-14
状态 离线
|
『第 10 楼』:
使用 LLM 解释/回答一下
这个批处理的功能是:
先调用一个exe程序(这个需要时间),然后再运行一个外在的bat文件(别人Supply),如果exe没启动好就运行bat就会报错。所以bat必需在exe后运行。
不知我表达的lxmxn能明白不?
The function of this batch processing is: First call an exe program (this takes time), and then run an external bat file (supplied by others). If the exe is not started properly and then the bat is run, it will report an error. So the bat must be run after the exe. I wonder if my expression lxmxn can understand it?
|
|
2007-3-20 23:26 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 11 楼』:
使用 LLM 解释/回答一下
exe 文件运行之后,延迟一下,大约4秒钟,然后再运行你的 bat 文件。
@echo off
start exefile.exe
ping 127.1 -n 5 >nul 2>nul
call batfile.bat
After the exe file runs, there is a delay of about 4 seconds, and then your bat file runs.
@echo off
start exefile.exe
ping 127.1 -n 5 >nul 2>nul
call batfile.bat
|
|
2007-3-20 23:31 |
|
|
ivanisme
初级用户
 
积分 30
发帖 13
注册 2007-3-14
状态 离线
|
『第 12 楼』:
使用 LLM 解释/回答一下
呵呵! 先谢谢lxmxn的回复
试了下MS可以 就是对-n 5有些疑问 查了下ntcmds 不得其解
时间是如何控制的,难道不可以控制吗?
小生愚钝,望lxmxn赐教!
Hehe! First of all, thank you for lxmxn's reply.
I tried it and MS works. Just have some questions about -n 5. I checked ntcmds but couldn't figure it out. How is the time controlled? Can't it be controlled?
I'm stupid, hope lxmxn can give me some advice!
|
|
2007-3-21 00:11 |
|
|
free2
初级用户
 
积分 124
发帖 10
注册 2004-4-22
状态 离线
|
『第 13 楼』:
使用 LLM 解释/回答一下
如果是我,我就在 B.BAT 中 CALL C.BAT ,再把剩下的A.BAT C/P 到 C.BAT 的结尾
If it were me, I would CALL C.BAT in B.BAT, and then put the remaining A.BAT C/P to the end of C.BAT
|
|
2007-3-21 01:25 |
|
|
ivanisme
初级用户
 
积分 30
发帖 13
注册 2007-3-14
状态 离线
|
『第 14 楼』:
使用 LLM 解释/回答一下
Originally posted by free2 at 2007-3-20 12:25 PM:
如果是我,我就在 B.BAT 中 CALL C.BAT ,再把剩下的A.BAT C/P 到 C.BAT 的结尾
<img src="images/smilies/face-surprise.png" align="absmiddle" border="0"> 你没搞明白呀
Originally posted by free2 at 2007-3-20 12:25 PM:
If it were me, I would CALL C.BAT in B.BAT, and then copy the remaining A.BAT C/P to the end of C.BAT
:o You didn't understand it!
|
|
2007-3-21 02:10 |
|
|
lxmxn
版主
       
积分 11386
发帖 4938
注册 2006-7-23
状态 离线
|
『第 15 楼』:
使用 LLM 解释/回答一下
Re ivanisme:
ping 命令有很多参数,其中有-n和-w两个参数,-n参数是表示发送的ICMP数据包的次数,而-w参数是表示超时的时间间隔的,意思就是如果ping不通指定的主机,在多少秒之后重新发送数据包。默认状态下,-w参数的值是1000,代表一秒,而-n参数指定的是发送的次数,所以指定了-n参数,就可以决定延迟的多少了,利用植树原理,你要延时n秒,那么参数-n就指定为n+1就行了。
ping 127.1 -n 5 这里的“-n 5”表示指定-n参数的值为5,所以大约延迟4秒钟。
Last edited by lxmxn on 2007-3-20 at 01:34 PM ]
Re ivanisme:
The ping command has many parameters, among which there are the -n and -w parameters. The -n parameter indicates the number of sent ICMP packets, and the -w parameter indicates the time interval for timeout, meaning if the specified host is not reachable via ping, after how many seconds the packet will be re-sent. By default, the value of the -w parameter is 1000, which represents one second, and the -n parameter specifies the number of sent times. So specifying the -n parameter can determine the amount of delay. Using the principle of planting trees, if you want to delay for n seconds, then the parameter -n is specified as n + 1.
ping 127.1 -n 5 Here, "-n 5" means specifying the value of the -n parameter as 5, so it delays approximately 4 seconds.
Last edited by lxmxn on 2007-3-20 at 01:34 PM ]
|
|
2007-3-21 02:16 |
|