BAT文件:打开新的命令窗口,并在那里输入code [英] BAT file: Open new cmd window and enter code in there

查看:412
本文介绍了BAT文件:打开新的命令窗口,并在那里输入code的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所有

我想在这里与.bat文件工作,它应该是一个非常简单的脚本,但我不知道如何做到这一点(我不熟悉它)。

I'm trying to work with a .BAT file here, it should be a very simple script but I don't know how to do it (I'm not familiar with it).

我想要做的就是打开一个新的命令窗口:
启动%WINDIR%\\ SYSTEM32 \\ CMD.EXE

What I'm trying to do is open a new command window: start %windir%\system32\cmd.exe

而code,我键入它(例如打印)的后面应该在那里显示:
回声在新窗口中考

And the code that I type behind it (a print for example) should show up in there: echo "test in new window"

我怎样才能做到这一点?

How can I do this?

所以,我需要做一些编码在一个新的命令窗口。任何人都可以帮助我在这?

So I need do to some coding in a NEW command window. Can anyone help me on this?

亲切的问候

推荐答案

您可能已经发现你的答案,因为这是前一段时间你问。但我想编码ROR时候做类似的事情。我希望能够运行在一个新的cmd窗口导轨服务器,所以我不必打开一个新的cmd,然后再次找到我的道路。

You may already find your answer because it was some time ago you asked. But I tried to do something similar when coding ror. I wanted to run "rails server" in a new cmd window so I don't have to open a new cmd and then find my path again.

我发现了什么是使用K开关是这样的:

What I found out was to use the K switch like this:

start cmd /k echo Hello, World!

CMD之前启动将打开一个新窗口和/ K应用程序会执行回声你好,世界!新的CMD后,就到了。

start before "cmd" will open the application in a new window and "/K" will execute "echo Hello, World!" after the new cmd is up.

您也可以使用/ C开关类似的东西。

You can also use the /C switch for something similar.

start cmd /C pause

这将执行暂停,但是当命令完成后关闭窗口。在这种情况下,你以后pressed一个按钮。我发现轨服务器这个有用的,然后当我关闭我的开发服务器,我没有后关闭窗口。

This will then execute "pause" but close the window when the command is done. In this case after you pressed a button. I found this useful for "rails server", then when I shutdown my dev server I don't have to close the window after.

这篇关于BAT文件:打开新的命令窗口,并在那里输入code的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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