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

查看:150
本文介绍了从批处理文件执行命令后,关闭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窗口?/a>

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?

这是我的简短剧本
start C:\"Program Files"\IBM\SQLLIB\BIN\db2cmdadmin.exe "db2 -tvf D:\stats.sql > D:\stats.output"

Here is my short script
start C:\"Program Files"\IBM\SQLLIB\BIN\db2cmdadmin.exe "db2 -tvf D:\stats.sql > D:\stats.output"

该命令有效,但完成后提示仍保持打开状态.我已经尝试过-
&&出口0",
下一行中的退出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"\IBM\SQLLIB\BIN\db2cmdadmin.exe /c "db2 -tvf D:\stats.sql > D:\stats.output"

查看全文

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