Solved

Check if firebird service is installed / running

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
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…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

760 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

20 Experts available now in Live!

Get 1:1 Help Now