简体   繁体   English

运行时如何使批处理文件从顶部开始?

[英]How do I make a batch file start at the top when run?

I've created a batch file, but when I run it and it loads, it goes down to where the user input is, cutting off part of my program.我创建了一个批处理文件,但是当我运行它并加载它时,它会下降到用户输入的位置,从而切断我的程序的一部分。

Is there any way to make it start at the top and make the user have to manually scroll it down to look at what he's entering in?有没有办法让它从顶部开始,让用户必须手动向下滚动才能查看他输入的内容?

If you mean you generate a lot of text to the console (more than one page worth) and then ask the user a question, like:如果您的意思是向控制台生成大量文本(超过一页),然后向用户提出问题,例如:

type bighonkintextfile
set /p answer=Yes?

I see only one quick solution.我只看到一个快速解决方案。 Don't just generate all that output.不要只生成所有 output。 Pass it through a pager of some sort, something like:通过某种寻呼机传递它,例如:

type bighonkintextfile | more
set /p answer=Yes?

Then the user will be able to read it from the top and once more exits, the user will be asked for a response.然后用户将能够从顶部读取它,并且more退出时,将要求用户做出响应。

If you want something more robust or pretty-looking, I'd be looking at doing that with a well-crafted executable rather than a batch file.如果您想要更强大或更漂亮的东西,我会考虑使用精心制作的可执行文件而不是批处理文件来实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM