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

15,067 Comments

  1. bonanza slot volatility, no deposit canada what is the most profitable casino in the world (Eartha) bonus and free spins bonus usa,
    or gambling commission usa

  2. captain cooks the diamond casino heist payout (Guillermo) united kingdom review, uptown pokies no deposit bonus 2021 united
    states and new online casinos for real money usa, or new usa live casino

  3. united statesn gambling stats us (Lorie) news, online
    slot casino usa and new zealandn online pokies minimum $5
    deposit, or top online pokies and casinos canadian open 2021

  4. casino las vegas usa, new zealandn online casino sign up no deposit bonus and casino chips
    value uk, or top 10 australian online casino

    Here is my blog post … can you buy stocks in casinos (Jani)

  5. regulation of why do i like gambling so much (Richard) in canada, how to
    win at roulette uk and new usa free spins no deposit, or minimum dollar 5 deposit casino australia

  6. new zealand casino no deposit bonus, pokies meaning
    australia and slot machines sale united states, or online canadian casino real
    money

    Feel free to surf to my web blog :: video blackjack odds (Penelope)

  7. I’ve been on Betbolt UK for a few months now and not gonna lie it’s grown on me. The slots section is pretty massive — must be somewhere around 3,500 games in total. Pragmatic Play and Play’n GO dominate the lobby, and Big Time Gaming slots mixed in as well. Gates of Olympus and Sweet Bonanza are still the talked-about titles, they load fine on the site. The one thing that bugged me — the lobby search isn’t the most intuitive, takes a bit of patience to find specific titles.

    The live table game section are powered by Evolution Gaming so you know you’re in safe hands. Crazy Time and Lightning Roulette — they’ve got all the big shows. Proper dealers, decent quality and no complaints on mobile either. Usually I drift between the slots and the live tables depending on what I fancy.

    Betbolt UK’s sign-up offer came as a matched deposit up to ?100 plus 50 free spins on a Pragmatic Play title. Wagering sits at 30x that’s nothing crazy by UK casino standards. There might be promo codes going — have a look at bet bolt before you deposit since promos get updated pretty regularly. Minimum deposit to get the bonus is ?20, standard stuff.

    Betbolt UK’s sportsbook is decent enough — EPL markets are extensive and they hold up to the main UK bookies. In-play works well most of the time, but occasionally the odds can lag a bit on busy matchdays. Not a dealbreaker but I did clock it.

    Betbolt UK cashouts have been solid on my end. Using a Visa debit and money’s come through in under 24 hours. Visa, Mastercard, Skrill and Neteller are all there, and there’s Bitcoin for those who want it. The site holds an MGA licence so there’s at least some regulatory oversight. Live chat is 24/7 and response was fast when I had a question about a withdrawal.

Leave a Reply

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