batch-file - 如何在 Cmd 中回显大于号?
问题描述
如何在 cmd 中回显“大于”字符?我想转义“大于”符号 ( >
),因为我需要它回显到另一个.bat
文件。
Echo net session>nul 2>&1>>2nd.bat
我需要 2nd.bat 文件中的这个输出:
net session>nul 2>&1
如果我不使用引号,则会在提示窗口中显示残缺的输出。
我不能使用引号,因为如果我使用它们,我的 2nd.bat 中的输出将变为"net session>nul 2>&1"
不运行。
解决方案
答案很简单。
您尝试了什么(评论的结果):
echo net session^>nul 2^>^&1>2nd.bat
我尝试过的(有效的):
echo net session^>nul 2^>^&1 >2nd.bat
推荐阅读
- javascript - React TypeError:this.fetchPosts 不是函数
- algorithm - OpenGL如何将图像映射到四边形?
- mysql - Laravel How Make DB raw can inside function
- ios - 离子构建失败 Info.plist not found
- javascript - 单选按钮 onclick 以更新表单
- java - 如果使用 Force Step Into,IntelliJ 不显示返回值?
- php - 如何通过php将数据发送到另一个页面
- java - 在自定义类上保存查询结果
- c# - 使用矩阵的 IndexOutOfRange 异常
- c++ - g++ 链接 RedHat 与 SUSE 期间未解析的符号