0

在批处理文件中,我有运行防病毒程序的这一行。我想确保它在批次移动到以下几行之前完成其工作。据我了解,开始/等待是等待。不幸的是,START/WAIT 破坏了代码行。

这是运行的代码:

"C:\Program Files (x86)\Anti-Virus\" d:\files\%1\ProcessFiles\%2-proc\*.*

此代码不运行:

START/WAIT "C:\Program Files (x86)\Anti-Virus\fsav" d:\files\%1\ProcessFiles\%2-proc\*.*

当这条线运行时,我收到一条错误消息:

"Windows cannot find 'd:\files\abc\ProcessFiles\abc-proc\*.*'. 
Make sure you typed the name correctly, and then try again."

当该错误提示打开时,如果我导航到该文件夹​​,那里有文件。

提前感谢您的帮助。

4

2 回答 2

1

使用来自SS64的提示,
始终包含一个TITLE这可以是一个简单的字符串,如“我的脚本”或只是一对空引号“”
根据 Microsoft 文档,标题是可选的,但如果省略它可能会遇到问题.

START "" /WAIT "C:\Your Anti-Virus\antivir" "d:\files\%1\ProcessFiles\%2-proc\*.*

于 2012-09-04T21:21:45.543 回答
1

START/WAIT不是一个单词,是两个用空格隔开的。
此外,如果文件名中有空格,则在文件规范周围加上双引号会有所帮助。

试试这个:

START /WAIT "C:\Program Files (x86)\Anti-Virus\fsav" "d:\files\%1\ProcessFiles\%2-proc\*.*"
于 2012-09-04T21:40:41.340 回答