批处理文件中的CTRL + Z命令 [英] CTRL+Z command in a batch file

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

问题描述

我在许多不同的网站上都在寻找我的问题的答案,但是什么也没有.

I looked up for answer to my question on many different websites but nothing.

我正在创建一个如下的批处理文件:

I am creating a batch file which is as follow:

@echo off
md C:\Users\John\Desktop\languages
cd C:\Users\John\Desktop\languages
md italian
md french
md german
md spanish
cd C:\Users\John\Desktop\languages\tedesco
copy con kartofeln.txt

This is the message I want to add into my text file

***CTRL + Z***

我现在如何编写可执行命令"CTRL + Z"以​​关闭该文件并继续进行编码? 我想创建此文件,然后双击它并一次执行每一行.

how can I now write an executable command "CTRL + Z" in order to close this file and continue my coding?? I want to create this file to then double-click it and execute every line all at once.

推荐答案

尝试将其放入文件中.

@echo off
****do stuff****
echo This is the message I want to add into my text file >> kartofeln.txt
****do stuff****

echo命令将文本放入stdout流中,该流通常会到达您在其中看到的控制台,但是在这里,我们使用>重定向它,以便stdout现在指向要回显的文件,从而有效地将其输出路由到文件. double >是这样,以便将输出附加到文件的末尾,而不是覆盖其内容.您可以多次执行此操作,对于要发送到文件的每一行,只需遵循相同的格式即可.

the echo command puts text into the stdout stream, which normally goes to the console where you see it, but here we redirect it with the > so that stdout now points to a file for echo, effectively routing its output into the file. the double > is so that the output is appended onto the end of the file instead of overwriting its contents. you can do this multiple times, just follow the same format for every line you want sent to your file.

一些(在我看来)很棒的批处理教程:

some (in my opinion) great batch tutorials:

http://www.dostips.com/

http://www.dreamincode.net/forums/topic/55203-batch-tutorial-part-1/

http://en.wikibooks.org/wiki/Windows_Batch_Scripting

http://www.didiermorandi.fr/vbscript/doc/Windows_Command_Line_Vic_Laurie.pdf

http://www.instructables.com 也为初学者提供了一些很好的教程.

also, http://www.instructables.com has some good tutorials for beginners.

,如果还有其他问题,那么您来对地方了,就问一下.

and, if you have any more questions, you are in the right place, just ask away.

这篇关于批处理文件中的CTRL + Z命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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