Progged programming site

Programming source code, articles, tutorials, links and chat

Add an entry to the application log

This VBScript example will add an entry to the application log
Const EVENT_SUCCESS = 0
Set objShell = Wscript.CreateObject(”Wscript.Shell”)
objShell.LogEvent EVENT_SUCCESS,”This is a test Application event log entry.

Bookmark It

Hide Sites

[ Back to top ]

Check if SQL Server is installed using VBScript

This is a VbScript example that uses WMI to check whether MS SQL Server is installed on a machine.
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 [...]

[ Back to top ]

Sponsors