到目前为止,人们在这里已经很棒了。完成搜索(尽管总是不够广泛!)。为什么这不起作用?if [true] and [true] then .... else .... batch
if [%_dpsUserUpdate%] == [false] if [%_dpsUserPrompt%] == [false] (
echo Both User Update and Prompt set to false. Run 7z silently.....
7z e "%_file%" -y > nul
) else (
echo Either User Update and/or Prompt set to true. Run 7z gui.....
7zG e "%_file%"
)
目标 - 如果Update和Prompt都设置为false,则运行7z。否则(对于其余3个排列)运行7zG。适用于“假和假”,但不适用于其他3种组合......
当然,我可以在那里贴一个“goto”,但总是感觉像'坏'编码(不知道为什么!)。
[如何在批处理文件中使用if-else结构?](http://stackoverflow.com/questions/11081735/how-to-use-if-else-structure-in-a-batch-file) – 2014-11-03 23:15:55
尝试'if [%_dpsUserUpdate%] [%_ dpsUserPrompt%] == [false] [false]('。 .. – JosefZ 2014-11-03 23:23:52
您需要准确显示您如何设置'_dpsuserupdate'和'_dpsuserprompt'。 – Magoo 2014-11-04 00:05:11