batch-file - 将多个命令传递给从批处理文件启动的批处理文件
问题描述
set consoleName="hello"
set batch=echo foo
start "%consoleName%" /max %batch% cmd.exe
这确实有效,输出:
foo
. 但是,执行任何超过一个命令的操作都不起作用:
set consoleName="hello"
set batch=(
echo %itchy%
if %itchy% lss 50 (echo foo)
else
(echo bar)
)
echo hi
start "%consoleName%" /max %batch% cmd.exe
输出:
System cannot open file (.
到目前为止,所有这些都不起作用:
set consoleName="hello"
set batch=echo foo , echo bar
set batch2= echo foo ^& echo bar
start "%consoleName%" /max %batch% cmd.exe
start "ex2" %batch%%batch% cmd.exe
start "ex3" %batch2% cmd.exe
输出结果为: hello: foo cmd.exe
ex2 : fooecho foo cmd.exe
(在命令提示符内:)
barecho foo
bar cmd.exe
例 3:foo cmd.exe
我不能使用clone
或call
,我必须使用start
。
解决方案
推荐阅读
- visual-studio - xamarin.forms - 葡萄牙语中的 Visual Studio 生成从 ContentView 派生的 ContentPage
- javascript - 动态更新进度条
- reactjs - 我是 reactjs 的新手,当我尝试运行我的第一个 react js 项目时它显示错误,它在设置后显示错误
- angular - 具有索引变量的角度组合框可在 ngfor 之外访问
- apache-flink - 查找未使用 coGroupFunction 分组的事件流
- autodesk-forge - 如何将 Forge App 限制为只读访问?
- regex - 使用正则表达式将电影文件名与可选部分匹配
- c# - WSS 支持 C# .exe 通过 https 工作
- mysql - mysqldump 禁止语法
- node.js - 使用版本号更新 Elasticsearch 中的文档