批处理文件月底前关闭? [英] Batch Closing before end of file?

查看:132
本文介绍了批处理文件月底前关闭?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个批处理来的东西自动命令。现在我只是运行一个命令和批处理关闭它显示出这个命令的输出之后。我把PAUSE在年底,但它保持运行过去吧。这可能是很简单的东西,我只是缺少。

I am trying to create a batch to automate commands for something. Right now I am just running a single command and the batch closes right after it prints the output from the command. I put a PAUSE in at the end but it keeps running past it. This is probably something very simple that I am just missing.

@echo
set /p ticket="Enter ticket number: "
tkt get %ticket%
PAUSE

在TKT GET%车票%的部分是从我使用的是自定义的工具。这一部分是绝对正确的格式,因为我用它通过命令提示符每天差不多。我要自动很多我的正常命令来使生活更轻松。

The tkt get %ticket% part is from a custom utility I am using. That part is definitely formatted properly because I use it through command prompt every day almost. I want to automate a lot of my normal commands to make life easier.

推荐答案

是TKT一个批处理文件?尝试使呼TKT代替。

Is "tkt" a batch file? Try making it "call tkt" instead.

如果你从另一个调用批处理文件,第一个将执行第二个相继退出,除非它被称为与呼。

If you call a batch file from another, the first one will exit after executing the 2nd one, unless it is called with "call".

下面是一个例子:

Foo1.bat

foo2.bat
echo foo1

Foo2.bat

echo foo2

好像如果你运行Foo1.bat,它会吐出既foo1和foo2的,但它不会:

It seems like if you run Foo1.bat, it will spit out both "foo1" and "foo2" but it does not:

C:\temp>foo1

C:\temp>foo2.bat

C:\temp>echo foo2
foo2

要改变行为,Foo1.bat应该是这样的:

To change the behavior, Foo1.bat should look like this:

foo1.bat

    call foo2.bat
    echo foo1

这篇关于批处理文件月底前关闭?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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