从批处理文件执行命令后关闭 db2cmd 提示符 [英] Close db2cmd prompt after command execution from a batch file

查看:22
本文介绍了从批处理文件执行命令后关闭 db2cmd 提示符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在执行命令后关闭 db2cmd.目标是在我使用任务调度程序安排它每天在 2100 小时运行之前让这个文件完美.批处理文件开始执行命令,命令被执行但提示没有关闭.

I am trying to close the db2cmd after executing a command. Goal is to get this file perfect before I schedule it with a task scheduler to run everyday at 2100 hours. The batch file starts execution of the command, the command gets executed but the prompt doesn't close.

我浏览了以下链接,但没有任何组合有效.
如何在运行后关闭命令行窗口批处理文件?
如何在批处理文件执行后自动关闭cmd窗口?

I have been through the below links but no combination is working.
How to close the command line window after running a batch file?
How to automatically close cmd window after batch file execution?

这是我的简短脚本
开始 C:"Program Files"IBMSQLLIBBINdb2cmdadmin.exe "db2 -tvf D:stats.sql > D:stats.output"

该命令有效,但提示在完成后仍保持打开状态.我试过做 -
"&& 退出 0",
下一行中的exit 0",
退出"在下一行,
"启动 db2cmdadmin "db2 -tvf D:stats.sql > D:stats.output""

The command works but the prompt remains open after completion. I have tried doing -
"&& exit 0",
"exit 0" in the next line,
"exit" in the next line,
"start db2cmdadmin "db2 -tvf D:stats.sql > D:stats.output""

但是没有任何东西可以关闭提示.我该如何纠正这个问题?

But nothing closes the prompt. How can I correct this?

推荐答案

您可能希望将命令行开关 /c 添加到您的命令中

You probably want to add the command line switch /c to your command

start C:"Program Files"IBMSQLLIBBINdb2cmdadmin.exe /c "db2 -tvf D:stats.sql > D:stats.output"

作为 手册中有说明.

这篇关于从批处理文件执行命令后关闭 db2cmd 提示符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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