Solved

Check if firebird service is installed / running

Posted on 2009-04-14
4
1,387 Views
Last Modified: 2012-05-06
Hi all,
I m preparing setup package for my vb.net application. This application needs firebird service to be run prior its launch.
Now i have to check if firebird is installed or not?
If installed whether it is running or not? Or is it stopped for now?
If it is stopped, then i have to make firebird service to run.
All these thing i want to do from command prompt..For this i want to write a batch file.
Please help....
0
Comment
Question by:DeskShare
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 7

Expert Comment

by:johnnash1180
ID: 24145343
You can get the Firebird service status by running 'sc query "<firebird service name>" ' command. If the firebird service was installed and running, u will get, "STATE              : 4  RUNNING" in result. If Firebird service is not installed, then you will get "EnumQueryServicesStatus:OpenService FAILED" error. Using this you can check the Firebird service.

You can start it by "net start <service name>" command.

Hope the above commands helps.
0
 
LVL 19

Expert Comment

by:NickUpson
ID: 24146192
it is however, worse than that. how about if firebird is already installed but a different version for a different application.
If you can use the embedded firebird server, this is installed with your application and is run via dll from your app
0
 

Author Comment

by:DeskShare
ID: 24147293
Whenever i try running - "sc query 'FirebirdGuardianDefaultInstance'"
it gives me error - 'sc' is not recognized as an internal or external command,
                              operable program or batch file.

M using Win 2000. Is this the problem?

PLease help me out...
So that i can create a batch file, which will check if Firebird service is installed/running?
Thankx...
0
 
LVL 7

Accepted Solution

by:
johnnash1180 earned 500 total points
ID: 24149599
sc command is available in Windows XP. For checking in service in Windows, you can either check registry entry for the service or use the net command.

Using net command, try start the service by "net start FirebirdGuardianDefaultInstance" command.

If service not installed, it will give "The service name is invalid." message.
If service is installed and started already, then it will give "The requested service has already been started." message.
If service is installed and not started, it will start the service.

You can workaround this using the above method.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Introduction: Recently, I got a requirement to zip all files individually with batch file script in Windows OS. I don't know much about scripting, but I searched Google and found a lot of examples and websites to complete my task. Finally, I was ab…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question