windows - 在一行中使用多个命令

标签 windows batch-file

我有这三个命令 - 如何在一行中执行它们?

@echo off
echo SomeText
pause

不像通常那样一个接一个地分批进行。

最佳答案

尝试用“&”连接它们

@echo off & echo SomeText & pause

它在大多数情况下都有效,但是带有“()”的更复杂的代码可能会导致问题,因为括号需要转义。

关于windows - 在一行中使用多个命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22709723/

相关文章:

Windows 8 中的 JavaFX 应用程序启动

c# - 如何在C#中运行具有所需权限的bat文件

batch-file - 批处理文件 : If registry key's data is equal to

windows - 将设备管理器导出到 txt 文件

batch-file - 如何将任务列表的CPU时间转换为CPU使用率?

c - Windows GDI : Difference Between a Pattern Brush & BitBlt of a Bitmap

c++ - 在 C++ 中抑制系统 ("ping") 输出

windows - 批处理脚本 : What's the difference between %0 and %~f0?

windows - %ERRORLEVEL% 无法在单行上运行多个命令

c++ - VirtualQueryEx 错误 - 页面太多