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

11,607 Comments

  1. BruceRiday BruceRiday

    Наши врачи выезжают от 10 минут до часа после получения вызова и проводят оценку состояния здоровья, включая измерение давления и пульса, взяв с собой необходимые препараты для капельницы. Срок приезда врача на дому связан с районом Санкт-Петербурга и занятостью бригады.
    Ознакомиться с деталями – [url=https://v.vivod-iz-zapoya-v-sankt-peterburge16.ru/]наркология вывод из запоя[/url]

  2. Здорова, народ Отец не выходит из штопора Соседи стучат в стену Таблетки не помогают Короче, единственное что вытащило из запоя — вывод из запоя волгоград круглосуточно Поставили капельницу с детоксикационным раствором В общем, телефон и цены тут — цена вывода из запоя анонимно [url=https://vyvod-iz-zapoya-na-domu-volgograd.ru]https://vyvod-iz-zapoya-na-domu-volgograd.ru[/url] Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  3. Hi there Dear, are you really visiting this web page daily, if so afterward you will without doubt get good experience.

  4. Беда пришла — запой затянулся. Скорая отказывается — а время не ждёт. Хорошо, что узнали — есть вывод из запоя на дому. Приезжают с оборудованием. Быстро приезжают. Ставят на ноги — профессионально. Анонимно и конфиденциально. Цены адекватные. снятие интоксикации на дому [url=https://alkogolizm.vyvod-iz-zapoya-na-domu-voronezh-eio.ru]https://alkogolizm.vyvod-iz-zapoya-na-domu-voronezh-eio.ru[/url] На сайте подробности. Уже обращался — помогли реально. Результат виден сразу. И без осложнений. Главное — не тянуть. Время не ждёт. Кому нужна срочная помощь — рекомендую. Выход есть всегда!

  5. Relocating — quite the journey. Had my turn not too long ago, and take my word for it, pretty intense. Think it’s just packing, then you see the mountain of stuff. Neighbors all recommended separate crews, but I couldn’t trust hearsay. So here’s the gist: when you’re on the hunt for trustworthy local movers, don’t just pick the first name. Think about this: experienced operators avoid common pitfalls — especially if you have tight deadlines. My approach — asked all the tough questions — and I mean it, it was absolutely worth the effort. So check this out that finally made sense to me. moving companies nevada [url=https://movers-in-nevada-lys.com]moving companies nevada[/url] That very page saved me heaps of time. You see the full picture — no hidden fees. Went with what I found and it went off without a hitch. Do your homework. Clarify the timeline. Quality service is worth its weight. Wishing you a smooth relocation!

  6. all new zealandn casino, free spins no deposit no wager uk 2021
    and 100 no deposit bonus codes 2021 canada, or online usa poker

    My web site :: craps table cover (Ellie)

  7. Changing homes — never a simple thing. Went through this not so long ago, and I’ll be upfront, quite the ride. Everybody says it’s straightforward, then reality sets in. Neighbors all recommended separate crews, but I wanted facts, not opinions. So here’s the gist: when you’re on the hunt for a dependable nevada moving company, get several quotes. Because: experienced operators avoid common pitfalls — especially if you have tight deadlines. I personally — asked all the tough questions — and seriously, it kept me out of trouble. Here’s something handy that brought some clarity. moving companies in nevada [url=https://movers-in-nevada-lys.com]moving companies in nevada[/url] That very page gave me a clear starting point. Everything’s straightforward — complete transparency. Went with what I found and it was surprisingly hassle-free. Don’t rush into anything. Verify their credentials. The right crew makes everything easier. Hope your move goes better than most!

  8. Беда приключилась — человек в запое уже давно. Врачи не могут вывести — нужно в клинику. Узнали куда можно обратиться. Есть профессиональная помощь — стационарное выведение. Постоянный контроль состояния. Детоксикация организма — всё под контролем врачей. Без лишних бумаг. Уход профессиональный. вывод из запоя в стационаре анонимно [url=https://kapelnica.vyvod-iz-zapoya-v-stacionare-samara11.ru]https://kapelnica.vyvod-iz-zapoya-v-stacionare-samara11.ru[/url] Вся информация по ссылке. Я сам обращался — без обмана. Человек приходит в себя. И что ценно — с реабилитацией. Чем раньше, тем лучше. Время не ждёт. Тем, кто в такой ситуации — не бойтесь. Выход есть всегда!

  9. Помощь оказывают врачи с практикой в наркологии, психиатрии и восстановительной терапии.
    Дополнительная информация – [url=https://v.vyvod-iz-zapoya-v-krasnoyarske17.ru/]вывод из запоя на дому цена Красноярск[/url]

  10. Jesseped Jesseped

    Даже хороший опыт предыдущего домашнего лечения не означает, что очередной запой пройдет так же. Тяжесть абстиненции способна меняться от случая к случаю. Поэтому доктор каждый раз оценивает состояние заново. Если существует серьезная угроза здоровью, скорая медицинская помощь и госпитализация могут оказаться безопаснее, чем попытка провести очищение организма дома.
    Изучить вопрос подробнее – [url=https://2.vyvod-iz-zapoya-reutov4.ru/]vyvod-iz-zapoya-reutov[/url]

  11. Making a move — always a big undertaking. Went through this not that far back, and no point sugarcoating, it was a handful. Everybody says it’s straightforward, then you realize what you’ve hoarded. A colleague had a different experience, but I couldn’t trust hearsay. What I came to realize: when you’re on the hunt for reliable moving services here, take your time deciding. Because: professional teams know the logistics — especially with large furniture. I personally — asked all the tough questions — and seriously, it was absolutely worth the effort. This is the resource that finally made sense to me. moving companies in nevada [url=https://movers-in-nevada-lys.com]moving companies in nevada[/url] That compilation gave me a clear starting point. Rates are displayed plainly — no hidden fees. Got my move scheduled there and the team was top-notch. Don’t rush into anything. Verify their credentials. The right crew makes everything easier. Wishing you a smooth relocation!

  12. Наркологическая помощь может потребоваться в любое время суток, поэтому прием заявок и вызов специалиста организуются круглосуточно. Дежурный нарколог уточняет состояние человека, длительность употребления, наличие хронического заболевания, принимаемые лекарства и другие данные, необходимые для предварительной оценки. Если ситуация позволяет оказать помощь дома, согласуется время приезда. При необходимости лечения в стационаре обсуждаются госпитализация и транспортировка.
    Получить больше информации – [url=https://n.narkologicheskaya-klinika-sankt-peterburg14.ru/]запой наркологическая клиника Санкт-Петербург[/url]

  13. Thomastaw Thomastaw

    При продолжительном приеме спиртного накапливаются продукты распада этанола, нарушается баланс жидкости и электролитов, возрастает нагрузка на сердце и сосуды. Алкогольная интоксикация вызывает изменения сна, настроения и поведения. Иногда развивается психоз; психиатрия относит подобные острые состояния к ситуациям, требующим срочной оценки специалиста. В таких случаях лечение в стационаре наиболее безопасно.
    Подробнее – [url=https://1.vyvod-iz-zapoya-balashiha5.ru/]vyvod-iz-zapoya-na-domu-nedorogo[/url]

  14. ElvinSot ElvinSot

    Наркологическая помощь может потребоваться в любое время суток, поэтому прием заявок и вызов специалиста организуются круглосуточно. Дежурный нарколог уточняет состояние человека, длительность употребления, наличие хронического заболевания, принимаемые лекарства и другие данные, необходимые для предварительной оценки. Если ситуация позволяет оказать помощь дома, согласуется время приезда. При необходимости лечения в стационаре обсуждаются госпитализация и транспортировка.
    Изучить вопрос подробнее – https://n.narkologicheskaya-klinika-sankt-peterburg14.ru/

  15. Moving out — always an ordeal. Had my share of moves not ages past, and I’ll be straight with you, no joke. Think you’ve got it covered, then you realize the scale. Another source pushed a different crew, but I wasn’t going on hearsay. The gist of it: if you’re after trustworthy local services, slow down. Look at it this way: experienced crews breeze through logistics — especially when heat’s a factor. My route — requested itemized breakdowns — and I’m completely serious, it was the best investment of time. Check this out that really cut through the noise. movers in nevada [url=https://movers-in-nevada-uwq.com]movers in nevada[/url] That list over there was incredibly helpful. Transparent pricing — zero fine print games. I actually went ahead and booked and everything ran like clockwork. Check every detail. Make sure everything’s in writing. Quality moving services pay off big time. May your move go better than expected!

  16. May May

    no deposit bonus casinos canada, blackjack mulligan uk and australian online
    no deposit casino, or online casino united states legal real money

    Also visit my blog post … talpakan live baccarat – May,

  17. Давно хотел — переехать в Израиль. Сбор документов — забирало силы. Какие справки нужны. Родственники подсказали — сопровождение в оформлении. Специалисты по репатриации сделали процесс прозрачным. Помогли с переводом — без головной боли. Паспорт был у меня через месяц. Без серых схем. Теперь я спокоен за своих детей. Кто хочет быстрого результата — не тяните. гражданство израиля помощь [url=https://grazhdanstvo-izrailya-pro.ru]https://grazhdanstvo-izrailya-pro.ru[/url] По ссылке — контакты специалистов кто хочет получить гражданство в свою историческую родину. Шаг к новой жизни начинается сегодня

  18. DavidMurce DavidMurce

    Этот текст посвящён сложным аспектам зависимости и её влиянию на жизнь человека. Мы обсудим психологические, физические и социальные последствия зависимого поведения, а также важность своевременного обращения за помощью.
    Детальнее – [url=https://russian-narkology.ru/narkologicheskaya-pomosch/konsultatsiya-narkologa/]консультация нарколога[/url]

  19. Nathanmat Nathanmat

    Помощь можно получить анонимно, с аккуратным оформлением и внимательным отношением к личным данным.
    Ознакомиться с деталями – [url=https://v.vyvod-iz-zapoya-v-krasnoyarske17.ru/]вывод из запоя на дому цена[/url]

Leave a Reply

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