Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6993973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:49:56+00:00 2026-05-27T19:49:56+00:00

Before going to install MSSQLSERVER, I want to know whether MSSQLSERVER is already installed

  • 0

Before going to install MSSQLSERVER, I want to know whether MSSQLSERVER is already installed in the system or not. This should be done programatically in C++ or mfc.

If the MSSQLServer is already installed in the windows then Is there any possible way to get the MSSql Credentials of that server?

If So, Please Explain the way to achieve this?

UPDATE

I tried to install sqlserver 2005 and sql server 2008 in my system but both the servers are installed. I checked the registry path but It contains SOFTWARE\Microsoft\Microsoft SQL Server\90 for MSSQLServer 2005 and SOFTWARE\Microsoft\Microsoft SQL Server\100 for MSSqlServer 2008.Before installing my MSSQLServer How can I check whether any of the MSSql Server version is installed or not?

EDIT

Till Now I silent installed the SQLSERVER programmatically in c++.

I Posted the code below:

SHELLEXECUTEINFO ShExecInfo;
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = NULL;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = L"D:\\Softies\\SQLEXPR.EXE";
ShExecInfo.lpParameters = L"/qn addlocal=all InstanceName=SQLEXPRESS DisableNetworkProtocols=0 SECURITYMODE=SQL SAPWD=root SQLAUTOSTART=1 SQLBROWSERAUTOSTART=1 ENABLERANU=0";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_MAXIMIZE;
ShExecInfo.hInstApp = NULL;

ShellExecuteEx(&ShExecInfo);

int nResult=0;
nResult = (int )ShExecInfo.hInstApp;
if( nResult >32) 
cout<<"EXE executed successfully"<<endl;
else
cout<<"Reason for failure is" <<nResult<<endl;
return 0;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T19:49:56+00:00Added an answer on May 27, 2026 at 7:49 pm
    • You cannot get the server’s credentials, except of brute force

    BUT

    If you’re a local administrator – you can start sql server from the command line with startup key -f and try to play with it – it is not guaranteed, but you can try.

    • I have a code which checks the some defaults for sql server instance, so it can be easily adopted to your needs and c++/

      private void GetSqlDefaultInfo(string ServerName, string InstanceName)
      {
      
          InstanceName = string.IsNullOrEmpty(InstanceName) ? "MSSQLSERVER" : InstanceName;
      
          if (string.IsNullOrEmpty(ServerName))
              ServerName = Environment.MachineName;
          using (var registryKey = RegistryKey.OpenRemoteBaseKey(RegistryHive.LocalMachine, ServerName))
          {
              object sqlInstance;
              using (var subKey = registryKey.OpenSubKey(@"SOFTWARE\Microsoft\Microsoft SQL Server\Instance Names\SQL"))
                  sqlInstance = subKey.GetValue(InstanceName);
              if (sqlInstance != null && !string.IsNullOrEmpty(sqlInstance.ToString()))
              {
                  var sqlPathKey = string.Format(@"SOFTWARE\Microsoft\Microsoft SQL Server\{0}\MSSQLServer",
                                                 sqlInstance);
                  object defaultData, defaultLog, backupDirectory, sqlPath;
                  using (var subKey = registryKey.OpenSubKey(sqlPathKey))
                  {
                      defaultData = subKey.GetValue("DefaultData");
                      defaultLog = subKey.GetValue("DefaultLog");
                      backupDirectory = subKey.GetValue("BackupDirectory");
                  }
                  sqlPathKey = string.Format(@"SOFTWARE\Microsoft\Microsoft SQL Server\{0}\Setup", sqlInstance);
      
                  using (var subKey = registryKey.OpenSubKey(sqlPathKey))
                      sqlPath = subKey.GetValue("SQLDataRoot");
                  DataFilePath = defaultData != null
                                     ? defaultData.ToString()
                                     : Path.Combine(sqlPath.ToString(), "Data").TrimEnd('\\');
      
                  LogFilePath = defaultLog != null
                                    ? defaultLog.ToString()
                                    : Path.Combine(sqlPath.ToString(), "Data").TrimEnd('\\');
                  FTSIndexFilePath = DataFilePath;
                  ContentFilePath = DataFilePath;
                  BackupFilePath = backupDirectory != null
                                       ? backupDirectory.ToString()
                                       : Path.Combine(sqlPath.ToString(), "Backup").TrimEnd('\\');
              }
          }
      }
      
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Should model objects that go to the view be checked for null before going
Before I start, I know there is this post and it doesn't answer my
I just installed eclipse on ubuntu OS . I was going to install android
I installed ruby-mbox by doing gem install ruby-mbox Running this: #!/usr/bin/ruby require 'rubygems' require
I want to develop a web application that uses the Twitter API. Before going
Last night before going to bed, I browsed through the Scalar Data section of
I am using SQLite C# library and as per my requirement, before going to
I need to read a BLOB and store it in a byte[], before going
I have reorganized the commits in a branch before it is going to be
Before you start flaming, I'm going to tell you that I am trying to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.