在批处理文件中,我有一行运行防病毒程序。我希望确保它在批次移动到以下行之前完成其工作。根据我的理解,START / WAIT是等待的。不幸的是,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."
当错误提示打开时,如果我导航到该文件夹,那里就有ARE文件。
提前感谢您的帮助。
答案 0 :(得分:1)
使用来自SS64的提示,
始终包含 TITLE 这可以是一个简单的字符串,如“我的脚本”或只是一对空引号“”
根据Microsoft文档,标题是可选的,但如果省略,可能会出现问题。
START "" /WAIT "C:\Your Anti-Virus\antivir" "d:\files\%1\ProcessFiles\%2-proc\*.*
答案 1 :(得分:1)
START/WAIT
不是一个单词,它是由空格分隔的两个单词
此外,如果文件规范中包含空格,则在文件规范周围放置双引号会有所帮助。
试试这个:
START /WAIT "C:\Program Files (x86)\Anti-Virus\fsav" "d:\files\%1\ProcessFiles\%2-proc\*.*"