Skip to content

Verify if a process is executing and notificate via e-mail on Windows

Hello,

A few days ago my friend need a Visual Basic Script to verify if a process is running and if it is send an e-mail. He asked me for help to code it, and I helped him.

Visual Basic Script to verify if a process is running and notify via e-mail.

Verify if a process is running with Visual Basic Script and shows a window if it is.
[code lang=”vb”]
set service = GetObject (“winmgmts:”)
for each Process in Service.InstancesOf (“Win32_Process”)
If Process.Name = processName then
wscript.echo “Notepad running”
wscript.quit
End If
next
[/code]

Send an e-mail using Visual Basic Script
[code lang=”vb”]
Const username = “USERNAME”
Const password = “PASSWORD”
Const smtpServer = “smtp.gmail.com”
Const port = 465
Const secure = True
Const userFrom = “FROM”
Const userTo = “TO”
Const emailSubject = “Subject”
Const emailText = “Text”

‘== CODE ==

Const cdoSendUsingPickup = 1 ‘Send message using the local SMTP service pickup directory.
Const cdoSendUsingPort = 2 ‘Send the message using the network (SMTP over the network).

Const cdoAnonymous = 0 ‘Do not authenticate
Const cdoBasic = 1 ‘basic (clear-text) authentication
Const cdoNTLM = 2 ‘NTLM

Set objMessage = CreateObject(“CDO.Message”)
objMessage.Subject = emailSubject
objMessage.From = userFrom
objMessage.To = userTo
objMessage.TextBody = emailText

‘==This section provides the configuration information for the remote SMTP server.

objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/sendusing”) = 2

‘Name or IP of Remote SMTP Servesr
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/smtpserver”) = smtpServer

‘Type of authentication, NONE, Basic (Base64 encoded), NTLM
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/smtpauthenticate”) = cdoBasic

‘Your UserID on the SMTP server
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/sendusername”) = username

‘Your password on the SMTP server
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/sendpassword”) = password

‘Server port (typically 25)
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/smtpserverport”) = port

‘Use SSL for the connection (False or True)
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/smtpusessl”) = secure

‘Connection Timeout in seconds (the maximum time CDO will try to establish a connection to the SMTP server)
objMessage.Configuration.Fields.Item _
(“http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout”) = 60

objMessage.Configuration.Fields.Update

objMessage.Send
[/code]

This two scripts are changed to work together to do what we want and have a config section.

Best Regards,
Matheus

References:
http://wiki.imacros.net/send-email.vbs
http://www.techimo.com/forum/applications-operating-systems/117464-need-vbulletin-script-check-see-if-process-running.html

Published inwindows

8,555 Comments

  1. Вывод из запоя в стационаре — это медицинская помощь в условиях полного контроля, где пациент находится под круглосуточным наблюдением врачей. В клинике сохраняется режим анонимности, а обработку персональных данных осуществляют строго по правилам конфиденциальности. Это особенно важно для клиента, который переживает за личного характера информацию, учет, работу, семью или репутацию. При обращении никто не передает сведения сотрудникам, партнерам, знакомым или родственникам без законных оснований и добровольного согласия.
    Подробнее можно узнать тут – https://vyvod-iz-zapoya-v-stacionare-v-moskve14.ru/

  2. Llevo unos cuantos meses en 888starz y para que mentir no esperaba gran cosa, porque por aqui te cansas de sitios que se caen cada dos por tres. Abrir la cuenta fue cosa de un rato minimo, correo, contrasena y listo, y el minimo para depositar ronda los 1 euro, que para probar viene de lujo.

    De tragaperras van sobrados — hablamos de 8.000 slots de proveedores como Pragmatic Play, NetEnt, Play’n GO, Betsoft y Yggdrasil. Mis habituales son Sweet Bonanza y Book of Dead, si bien he tocado tambien los Megaways. Lo que si el buscador va un poco lento cuando hay tantisimo.

    La zona en vivo corre a cargo de Evolution y se nota la diferencia: mesas con crupier en espanol, los game shows tipo Crazy Time para el que le guste el show. La oferta de entrada es de un 100% hasta 300€ con 100 tiradas gratis, hay que apostarlo unas 35 veces, nada raro comparado con otros. Va rotando alguna promo sin deposito, puedes mirar lo que hay vigente directamente en [url=https://888starz-es9.com/promocode]888starz promo code 2026[/url] antes de meter dinero.

    El tema de sacar pasta va bastante fino. Saque la semana pasada por Skrill y me llego en menos de una hora. Por Visa o Mastercard tarda mas, eso ya es cosa del banco. Van con Neteller, Bitcoin que es lo mas rapido con diferencia.

    Desde el movil cumple, tienen app para Android pero yo uso el navegador y me sobra. El soporte responde en espanol, me atendieron rapido con una duda de documentacion. Licencia de Curazao, que no es la DGOJ y hay que saberlo antes de entrar. Por ahora no me ha fallado, pero ojo con el rollover de las promos.

  3. united states casinos that allow gambling at 18 –
    Gabriela – sites, usa friendly casino
    no deposit free spins 2021 and canadian roulette app, or 2021 no deposit bonus codes
    uk

  4. united statesn roulette online fast, online casino games for
    real money uk and australia gambling statistics, or dragon link online pokies canada

    Feel free to visit my web page – how many casinos
    are in black hawk [Mariano]

Leave a Reply

Your email address will not be published. Required fields are marked *