如何停止在命令行中作为应用程序运行的firebird进程?

时间:2018-03-18 07:45:49

标签: windows firebird

我们可以使用命令行运行Firebird作为应用程序:

Credentials.getClient(context)
    .request(credentialRequest)
    .addOnCompleteListener { task ->
        if(task.successful) {
            logInWithCredential(...)
            return;
            // for this part, blue banner is shown as normal
        }

        if(task.exception == CommonStatusCodes.RESOLUTION_REQUIRED) {
            // request user to choose credential
            // after a credential is chosen, blue banner is not shown
        }
    }

是否可以使用命令行关闭firebird进程?

1 个答案:

答案 0 :(得分:1)

没有“简单”的方法。如果您将firebird.exe作为应用程序启动,则可以通过右键单击任务栏中的图标并选择关闭来退出它。

唯一的选择是使用taskkill杀死它,例如:

taskkill /IM firebird.exe

这有以下缺点:

  • 如果您有活动连接,这将产生一个弹出窗口,要求确认关闭(就像从任务栏执行此操作时)
  • 如果您有多个firebird.exe进程,它们将全部终止

你也可以强迫kill关闭,这不会产生弹出窗口;打开的连接将在没有提示的情况下被杀死:

taskkill /F /IM firebird.exe

但是,如果您经常需要这样做,最好将Firebird安装为不自动启动的Window服务。然后,您可以使用NET STARTNET STOP(或使用instsvc)来控制服务。

例如,将Firebird安装为服务(需要管理员命令提示符):

instsvc install -demand -name firebird3

这会创建一个名为"Firebird Server - firebird3"

的服务

然后,您可以使用NET START "Firebird Server - firebird3"NET STOP "Firebird Server - firebird3"启动和停止服务,但这也需要提升管理员权限。