Can anyone point me to a vbscript (using WMI) to find out the installed SQL Server version. I have a scenario where either SQL Server 2008 R2 or SQL Server 2012 could be installed on a machine.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
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.
Based on the code in the first Google search result here:
Note that WMI is not the fastest way to do this. Have you considered checking the registry directly instead of going through WMI?
UPDATE given OP’s solution using the registry instead, and with the assumption that exactly one of 2008R2 or 2012 could be installed: