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
Solved

Check if firebird service is installed / running

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

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…
Being a system administrator some time we require to do things remotely, one of them is installing software. Here I am going to tell you how to install software through wmic (Windows management instrument console). I am not at all saying that this i…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

860 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