从创建批处理文件新的批处理文件

编程入门 行业动态 更新时间:2024-10-26 23:40:36
本文介绍了从创建批处理文件新的批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

是否有可能从现有的新的批处理文件?例如用Java,C ++ pretty以外的​​其他语言,我可以运行一个.exe文件,并创建独立code不同的.exe文件。这是可能的批处理文件怎么办?

比方说,我想test.bat的是这个

回声你好你好

和我想它来创建另外一个bat文件名为这test2.bat将包含此:

回声喜喜

解决方案

您可以使用的呼应并输出重定向到一个批处理文件:

  • test.bat的

    关闭@echo@echo你好你好@echo回声喜喜> test2.bat@echo回声追加东西>> test2.bat

一> 以创建/覆盖已经存在的任何文件;两个方式> 字符追加到文件

Is it possible to create a new batch file from an existing? For example in Java, C++ pretty much any other language I can run one .exe and create a different .exe with separate code. Is this possible to do in batch files?

Let's say I want test.bat to be this

echo hello hello

and I want it to create another .bat file called test2.bat which will contain this:

echo hi hi

解决方案

You can use echo and redirect the output to a batch file:

  • test.bat

    @echo off @echo hello hello @echo echo hi hi > test2.bat @echo echo append something >> test2.bat

One > to create/overwrite any file that already exists; two > characters to append to the file.

更多推荐

从创建批处理文件新的批处理文件

本文发布于:2023-05-27 19:33:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/300565.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:批处理文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!