查看SQL状态的vbs
时间:2021-05-25 08:21:30|栏目:VBS|点击: 次
复制代码 代码如下:
'****************************
'*by r05e
'*检验SQL SERVER是否在这机器上工作
'****************************
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colServices = objWMIService.ExecQuery _
("Select * from Win32_Service Where Name = 'MSSQLServer'")
If colServices.Count > 0 Then
For Each objService in colServices
Wscript.Echo "SQL Server is " & objService.State & "."
Next
Else
Wscript.Echo "SQL Server is not installed on this computer."
End If
上一篇:好玩的vbs特色代码第1/6页
栏 目:VBS
下一篇:vbs 定时删除功能实现代码
本文标题:查看SQL状态的vbs
本文地址:http://www.codeinn.net/misctech/128385.html