问题描述
我写一个批处理文件自动执行某些任务。我可以从命令窗口中运行它,它运行并显示结果。如果我是双从资源管理器虽然点击它,它运行,并立即终止,所以我不能看到的结果。
I've written a batch file to automate some tasks. I can run it from a command window and it runs and displays results. If I double click it from explorer though, it runs and terminates immediately so I can't see the results.
有没有一种方法可以让我做,直到我关闭它,如果我用它启动批处理文件窗口继续开放,双击该图标?
Is there a way I can make batch file window stay open until I dismiss it if I started it by double-clicking the icon?
我不想必须通过/ NOPAUSE参数或东西时,我称之为命令行的批处理文件。我想一个解决方案,我可以使用批处理文件,而无需做什么太特别的?
I don't want to have to pass a /nopause parameter or something when I call a batch file from the command line. I'd like a solution where I can use the batch file without having to do anything too special?
感谢。
注意我不希望它在命令行中运行时暂停!我可以从另一个批处理文件调用此批处理文件进行操作的负载。在这种情况下,我不能坐在那里,保持按下回车键。
NOTE I don't want it to pause when running from the command line!! I may call this batch file from another batch file to carry out a load of operations. In that case I can't be sitting there to keep hitting enter.
理想情况下是最好的,如果我可以把一些code在批处理文件中,因此可以制定出了它是从开始,然后暂停或没有适当的。
Ideally it would be best if I can put some code in the batch file so it can work out where it was started from, and then pause or not as appropriate.
推荐答案
使用:
cmd /K myBatch.bat
作为你的快捷方式。
as your shortcut.
这篇关于如何使Windows批处理文件暂停时,双击?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!