我想创建一个批处理文件,该文件创建一个批处理文件,该文件创建文本文件
我想创建一个创建批处理文件2的批处理file1,此批处理文件2应该创建一个txt文件。 以下是我要附加到批处理文件的4行脚本。我需要批处理file1的代码。 请帮助
echo > t.txt
:r
echo 101010101010 >> t.txt
goto r
P.S:我是堆栈溢出的新手,只有我的帐户是旧的。到目前为止,我还不知道这是真的 权力,但我已经意识到..(请原谅我是非正式的)
I want to Create a Batch File1 Which Creates a Batch File2, This Batch File2 Should then Create a txt file.
Below is the 4 lines script i Want to Append to Batch File2. I need Code for Batch File1.
Please Help
echo > t.txt
:r
echo 101010101010 >> t.txt
goto r
P.S: I am new to Stack Overflow, only my account is old. until now i did not know it's True
Powers, but i'm realising.. (excuse me for being informal)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请参阅如何逃脱字符
batchfile1.batchfile1.batchfile1.bat /em>可以创建第二个批次文件 batchfile2.bat
Refer to How to Escape Characters
BATCHFILE1.bat that can create the second batch file BATCHFILE2.bat
批处理file2.cmd
应该看起来像这样:除非当前目录不可写,否则第一行将创建您的文本文件。如果是这样,您的批处理文件将简单地关闭而无需输入循环。循环中的代码将打印您所需的字符串而不包括任何尾随空间。
为了停止写入文件,您需要输入 ctrl + ctrl c
因此,要从
批处理file1.cmd
输出它:使用此方法,您只需要逃脱通常的特殊字符,以及任何嵌套的闭合括号。在上面的特殊字符中,是重定向和管子字符。
Batch File2.cmd
should look like this:The first line will create your text file, unless the current directory is not writeable. Should that be the case, your batch file will simply close without entering the loop. The code in the loop will print your required string without including any trailing spaces.
In order to stop writing to the file, you will need to enter Ctrl+C
Therefore to output it from
Batch File1.cmd
you'd need:Using this method, you simply need to escape the usual special characters, plus any nested closing parentheses. In the above your special characters are the redirection and pipe characters.