从创建批处理文件新的批处理文件 [英] Create new batch file from batch file

查看:158
本文介绍了从创建批处理文件新的批处理文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有可能从现有的新的批处理文件?例如用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.

这篇关于从创建批处理文件新的批处理文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆