两个DOS命令的执行时间间隔(批处理脚本) [英] Execution time gap of two DOS commands (batch script)

查看:687
本文介绍了两个DOS命令的执行时间间隔(批处理脚本)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个批处理脚本,它首先将文件从一个位置复制到另一个文件夹,然后在文本文件中创建一个文件名列表:



下面代码:



COPY \\CDFS23001 \\ SOURCE\ORG\ *帐户* .xml \\CDFS23001 \\ SOURCE \\ \\ tGT \



dir / b \\CDFS23001 \\ SOURCE\TGT \ * ACCOUNTS * .xml> \\CDFS23001 \\ SOURCE\TGT \List_Accounts.txt



首次复制命令将文件从ORG文件夹复制到TGT文件夹,然后列出文件名已创建。



有时,尽管ORG位置存在帐户文件,List_Accounts.txt也没有任何名称。



是否有可能在文件被COPY命令完全复制到TGT(目的地)文件夹之前第二个命令dir / b被执行?



如果发生这种情况我该怎么办才能在这两个命令之间有一些等待时间?



请建议



我尝试了什么:



我认为Timeout 60会产生60秒的时间间隔,但是如果复制文件需要更多时间,那么它也可能会失败。文件的大小永远不会修复。

I have a batch script which first copies file from one location to other folder and then creates a list of name of the files in a text file:

Below Code:

COPY \\CDFS23001\\SOURCE\ORG\*ACCOUNTS*.xml \\CDFS23001\\SOURCE\TGT\

dir /b \\CDFS23001\\SOURCE\TGT\*ACCOUNTS*.xml > \\CDFS23001\\SOURCE\TGT\List_Accounts.txt

First copy command copies file from ORG folder to TGT folder and then a list of filename is created.

Sometimes the List_Accounts.txt doesnt have any name inspite of accounts file being present in ORG location.

Is it possible before the file(s) is (are) completely completely copied to TGT (destination) folder by COPY command the second command dir /b gets executed ?

If this is happening what can I do to have some wait time between these two commands ?

Please suggest

What I have tried:

I think Timeout 60 will create a time gap of 60 seconds, but in case if more time is required to copy files then it might fail too. The size of the files is never fixed.

推荐答案

这不是时间问题。



这是一个拼写问题。在一行上查看帐户,在下一行查看帐户。
It's not a timing problem.

It's a spelling problem. Look at your "ACCOUNTS" on one line and "ACCOUNT" on the next.


这篇关于两个DOS命令的执行时间间隔(批处理脚本)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆