Header Ads

Check sql server installed in our system or not...

SQL Server


< asp:button1 id="button" runat="server" text="Click" onclientclick="greeting();"/ >

< script type="text/vbscript" >
function greeting()
Dim intCounter, strSubkey
Const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."

Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Microsoft"

objReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys

intCounter=0
For Each subkey In arrSubKeys

If subkey="Microsoft SQL Server" Then

intCounter=1
strSubkey=subkey
End If

Next
alert(intCounter)

if intCounter=0 then

alert("No IIS installed")

exit function
Elseif intCounter=1 then
alert(strSubkey & " -is installed " )

End If
alert("end")
end function
< /script >

No comments:

Powered by Blogger.