Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim AllProcess
Dim Process
Dim strFoundProcess
strFoundProcess = False
Set AllProcess = getobject("winmgmts:") 'create object
For Each Process In AllProcess.InstancesOf("Win32_process")
If (Instr (Ucase(Process.Name),"TASKMGR.EXE") = 1) Then
msgbox "Application is running"
strFoundProcess = True
Exit for
End If
Next
If strFoundProcess = False Then
msgbox "Application is not running"
End If
Set AllProcess = nothing
Sub SendAlertEmail()
Set pc = CreateObject("Wscript.Network")
Set iMsg = CreateObject("CDO.Message")
Set iConf = CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
Const schema = "[URL unfurl="true"]http://schemas.microsoft.com/cdo/configuration/"[/URL]
dim emailBody
Flds.Item(schema & "sendusing") = 2
Flds.Item(schema & "smtpserver") = "143.323.xxx.xxx"
Flds.Item(schema & "smtpserverport") = 25
Flds.Item(schema & "smtpauthenticate") = 0
'Flds.Item(schema & "sendusername") = "domain\username"
'Flds.Item(schema & "sendpassword") = "yourpass"
Flds.Item(schema & "smtpusessl") = 0
Flds.Update
With iMsg
.To = mail@mail.com, mail2@mail.com"
.From = "Process Alert <administrator@mail.com>"
.Subject = processName & " has quit"
emailBody = "<font color='red'><h2>'" & processName & "' has unexpectedly quit</h2></font>"
emailBody = emailBody & "<b>Server: </b>" & pc.ComputerName & "<br />"
emailBody = emailBody & "<b>Process: </b>" & processName & "<br />"
emailBody = emailBody & "<b>Location: </b>" & processPath & processName & "<br />"
emailBody = emailBody & "<b>Time: </b>" & Now & "<br /><br />"
emailBody = emailBody & "<b>Attempting to restart '" & processName & "'</b><br /><br />"
emailBody = emailBody & "<font color='#808080'>Please check that the process has restarted correctly.<br />"
'emailBody = emailBody & "
.HTMLBody = emailBody
.Sender = "Process Alert <administrator@mail.com>"
.Organization = "Your Company"
.ReplyTo = "replyhere@mail.com"
Set .Configuration = iConf
.Send
End With
' Release Interfaces
Set iMsg = nothing
Set iConf = nothing
Set Flds = nothing
End Sub
Function ProcessIsInList(sProcessToCheck)
Dim arrProcessList, sProcess
arrProcessList = Array("TASKmgr.exe","progr1.exe","prog2.exe")
For Each sProcess in arrProcessList
If UCase(sProcess) = UCase(sProcessToCheck) Then
ProcessIsInList = True
Exit Function
End If
Next
ProcessIsInList = False
End Function
Dim AllProcess
Dim Process
Dim strFoundProcess
Dim count
strFoundProcess = False
Set AllProcess = getobject("winmgmts:")
For Each Process In AllProcess.InstancesOf("Win32_process")
If ProcessIsInList(Process.Name) Then
count = count+1
msgbox "Found " & count
strFoundProcess = True
Exit For
End If
Next
If strFoundProcess = False Then
msgbox "Application is not running"
End If
Set AllProcess = nothing
Function ProcessIsInList(sProcessToCheck)
Dim arrProcessList, sProcess
arrProcessList = Array("taskmgr.exe", "winword.exe", "firefox.exe")
For Each sProcess in arrProcessList
If UCase(sProcess) = UCase(sProcessToCheck) Then
ProcessIsInList = True
Exit Function
End If
Next
ProcessIsInList = False
End Function