Solved

Check if firebird service is installed / running

Posted on 2009-04-14
4
1,354 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
  • 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

One of my most closely kept secrets is revealed in this discussion How to output text on the same line This question was recently posted in EE by Simon336697 (http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_2459…
TOMORROW TOMORROW.BAT is inspired by a question I get asked over and over again; that is, "How can I use batch file commands to obtain tomorrow's date?" The crux of this batch file revolves around the XCOPY command - a technique I discovered w…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

813 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now