Solved

Check if firebird service is installed / running

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.
A company’s greatest vulnerability is their email. CEO fraud, ransomware and spear phishing attacks are the no1 threat to a company’s security. Cybercrime is responsible for the largest loss of money to companies today with losses projected to r…

911 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

21 Experts available now in Live!

Get 1:1 Help Now