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,098 Comments

  1. Beginners find these calculators particularly useful for understanding bet outcomes.
    accumulator each way calculator [url=single-bet-calculator.uk/bet-calculator/accumulator]https://single-bet-calculator.uk/bet-calculator/accumulator/[/url]

  2. Mastering this calculator helps bettors make more informed and successful betting choices.
    betting calculator double [url=http://www.single-betcalculator.uk/bet-calculator/double/]https://single-betcalculator.uk/bet-calculator/double/[/url]

  3. You only need to enter the stake and the odds to get your potential winnings.
    single calculator [url=http://www.single-betcalculator.com]https://single-betcalculator.com/[/url]

  4. These calculators are user-friendly and require no advanced knowledge.
    double bet returns calculator [url=http://www.single-bet-calculator.uk/bet-calculator/double]https://single-bet-calculator.uk/bet-calculator/double/[/url]

  5. Awareness of potential profits enables better control over betting amounts.
    calculate a betting accumulator [url=https://single-betcalculator.uk/bet-calculator/accumulator/]calculate a betting accumulator[/url].

  6. If you are into betting, using a single bet calculator can be extremely helpful.
    double accumulator calculator [url=http://www.single-betcalculator.uk/bet-calculator/double]https://single-betcalculator.uk/bet-calculator/double/[/url]

  7. OMT’s mindfulness strategies reduce mathematics stress ɑnd anxiety, enabling genuine love t᧐ expand and insire examination excellence.

    Expand youг horizons ԝith OMT’ѕ upcoming neᴡ physical area opening іn September 2025, uѕing a ⅼot more opportunities for hands-on mathematics
    exploration.

    Ƭhe holistic Singapore Math approach, ԝhich constructs
    multilayered рroblem-solving abilities, highlights ѡhy math tuition іs impоrtant for mastering the curriculum and preparing
    fⲟr future professions.

    primary school school math tuition іs vital fⲟr PSLE preparation ɑs it
    helps students master tһe fundamental concepts ⅼike fractions and
    decimals, which are gгeatly checked іn the examination.

    In Singapore’ѕ affordable education landscape, secondary math tuition ցives the additional
    siԀе needed tօ stand apaгt іn O Level rankings.

    Tuition gives аpproaches for time management tһroughout tһe extensive ALevel mathematics tests,
    allowing students tο assign efforts effectively аcross ɑreas.

    Tһe proprietary OMT educational program attracts attention Ƅy
    integrating MOE curriculum elements ᴡith gamified quizzes ɑnd difficulties tⲟ maҝe discovering more delightful.

    Assimilation ѡith school reseɑrch leh, making tuition а seamless extension fⲟr grade enhancement.

    Specialized math tuition fⲟr O-Levels helps Singapore secondary
    students separate tһemselves in a crowded applicant swimming pool.

    Ꮋere iѕ my web page; secondary 1 math tuition singapore

  8. Shermandop Shermandop

    В этой статье обсуждаются актуальные медицинские вопросы, которые волнуют общество. Мы обращаем внимание на проблемы, касающиеся здравоохранения и лечения, а также на новшества в области медицины. Читатели будут осведомлены о последних событиях и смогут следить за тенденциями в медицине.
    Перейти к статье – [url=http://ladies-paradise.ru/kak-vyilechit-pivnoy-alkogolizm/]клиника плюс тверь[/url]

  9. A good single bet calculator can handle multiple odds formats as they vary in betting.
    double calc [url=http://singlebetcalculatorfree.uk/bet-calculator/double/]https://singlebetcalculatorfree.uk/bet-calculator/double/[/url]

  10. Donaldmuh Donaldmuh

    Этот краткий обзор предлагает сжатую информацию из области медицины, включая ключевые факты и последние новости. Мы стремимся сделать информацию доступной и понятной для широкой аудитории, что позволит читателям оставаться в курсе актуальных событий в здравоохранении.
    Открыть полностью – [url=https://old-lekar.com/chto-takoe-sit-kodirovanie/]кодировка sit mst[/url]

  11. One must enter the stake amount along with the bookmaker’s odds to get results.
    treble accumulator calculator [url=http://singlebetcalculatorfree.uk/bet-calculator/treble/]https://singlebetcalculatorfree.uk/bet-calculator/treble/[/url]

  12. http://aida-grafik.de/
    Aida Grafik ist ein vertrauenswuerdiger Partner ausgerichtet auf den nationalen Rahmen Deutschlands, das bereitstellt professionelle Begleitung fuer alle die Ergebnisse suchen, sich auszeichnend durch auf Servicequalitaet. Entdecken Sie mehr hier.

  13. http://aida-grafik.de/
    Das Projekt Aida Grafik praesentiert sich als ein professionelles Unternehmen fokussiert auf das Publikum in Deutschland, das bereitstellt massgeschneiderte Loesungen fuer alle die Ergebnisse suchen, mit Schwerpunkt auf Servicequalitaet. Erfahren Sie mehr hier.

  14. The calculator usually provides an option to choose the type of odds representation.
    treble odds [url=https://www.single-bet-calculator.uk/bet-calculator/treble/]https://single-bet-calculator.uk/bet-calculator/treble/[/url]

  15. In conclusion, a single bet calculator is a practical and user-friendly tool.
    each way acca calculator [url=http://www.single-bet-calculator-free.com/bet-calculator/accumulator]https://single-bet-calculator-free.com/bet-calculator/accumulator/[/url]

  16. This minimizes surprises and helps maintain responsible betting habits.
    accumulator calculator football [url=https://single-betcalculator.uk/bet-calculator/accumulator/]accumulator calculator football[/url].

  17. horse accumulator calculator [url=https://singlebetcalculator.uk/bet-calculator/accumulator/]https://singlebetcalculator.uk/bet-calculator/accumulator/[/url]

  18. These calculators are invaluable for those new to betting.
    single horse bet calculator [url=http://www.single-bet-calculator-free.com/]https://single-bet-calculator-free.com/[/url]

  19. By regularly using a single bet calculator, you can improve your betting strategy.
    single bets calculator [url=https://single-bet-calculator.uk]https://single-bet-calculator.uk/[/url]

  20. These calculators enhance transparency by displaying clear profit possibilities.
    fractional to decimal odds [url=https://single-bet-calculator-free.com/odds-explained/]fractional to decimal odds[/url].

  21. http://am-webdesign.de/
    Am Webdesign etabliert sich als ein professionelles Unternehmen ausgerichtet auf die deutsche Wirtschaftslandschaft, das anbietet professionelle Begleitung fuer alle die Ergebnisse suchen, mit Schwerpunkt auf Vertrauen und Transparenz. Entdecken Sie mehr ueber den Link.

  22. http://am-webdesign.de/
    Das Unternehmen Am Webdesign etabliert sich als ein spezialisierte Agentur ausgerichtet auf die deutsche Wirtschaftslandschaft, das ermoeglicht professionelle Begleitung fuer Unternehmen und Privatpersonen, mit Schwerpunkt auf Servicequalitaet. Mehr Informationen hier.

  23. KeithSlics KeithSlics

    Этот обзор сосредоточен на различных подходах к избавлению от зависимости. Мы изучим традиционные и альтернативные методы, а также их сочетание для достижения максимальной эффективности. Читатели смогут открыть для себя новые стратегии и подходы, которые помогут в их борьбе с зависимостями.
    Смотрите также – [url=https://razvitie-malysha.com/vospitanie/sovety/raskodirovanie-ot-alkogolya-metody-posledstviya-i-bezopasnye-podhody.html]лечение пивного алкоголизма[/url]

  24. DavidToomo DavidToomo

    В этой публикации мы исследуем ключевые аспекты здоровья, включая влияние образа жизни на благополучие. Читатели узнают о важности правильного питания, физической активности и психического здоровья. Мы предоставим практические советы и рекомендации для поддержания здоровья и развития профилактических подходов.
    Желаете узнать подробности? – [url=https://buhuchet-info.ru/mix/pivnoj-alkogolizm-pochemu-lechenie-v-klinike-luchshij-vybor.html]лечение пивного алкоголизма[/url]

  25. JamesPet JamesPet

    Публикация посвящена жизненным историям людей, успешно справившихся с зависимостью. Мы покажем, что выход есть, и он начинается с первого шага — принятия проблемы и желания измениться.
    Прочесть заключение эксперта – [url=https://yogasam.ru/raznoe/kodirovanie-ot-alkogolizma-na-domu.html]clinica plus в твери[/url]

  26. http://bartalomej.de/
    Das Projekt Bartalomej praesentiert sich als ein erfahrene Beratung praesent im die deutsche Wirtschaftslandschaft, das liefert hochwertige Dienstleistungen fuer alle die Ergebnisse suchen, sich auszeichnend durch auf Ergebnisse. Erfahren Sie mehr ueber den Link.

  27. DavidToomo DavidToomo

    В этом обзоре мы обсудим современные методы борьбы с зависимостями, включая медикаментозную терапию и психотерапию. Мы представим последние исследования и их результаты, чтобы читатели могли быть в курсе наиболее эффективных подходов к лечению и поддержке.
    Только факты! – [url=http://www.pw-info.ru/mixon/kvalificirovannoe-lechenie-pivnogo-alkogolizma-v-tveri/]лечение пивного алкоголизма клиника[/url]

  28. RichardHoT RichardHoT

    В данном обзоре представлены основные направления и тренды в области медицины. Мы обсудим актуальные проблемы здравоохранения, свежие открытия и новые подходы, которые меняют представление о лечении и профилактике заболеваний. Эта информация будет полезна как специалистам, так и широкой публике.
    Смотри, что ещё есть – [url=https://progorod58.ru/lechenie-pivnogo-alkogolizma]clinica plus в твери[/url]

  29. Shermandop Shermandop

    Этот обзор посвящен успешным стратегиям избавления от зависимости, включая реальные примеры и советы. Мы разоблачим мифы и предоставим читателям достоверную информацию о различных подходах. Получите опыт многообразия методов и найдите подходящий способ для себя!
    Подробнее можно узнать тут – [url=http://ladies-paradise.ru/kak-vyilechit-pivnoy-alkogolizm/]клиника плюс тверь[/url]

  30. http://bk-designs-gbr.de/
    Das Projekt Bk Designs Gbr positioniert sich als ein spezialisierte Agentur fokussiert auf das Publikum in Deutschland, das anbietet ganzheitliche Ansaetze fuer alle die Ergebnisse suchen, mit Schwerpunkt auf persoenliche Betreuung. Erfahren Sie mehr auf der offiziellen Website.

  31. http://bk-designs-gbr.de/
    Das Unternehmen Bk Designs Gbr positioniert sich als ein erfahrene Beratung spezialisiert auf den deutschen Markt, das bereitstellt massgeschneiderte Loesungen fuer alle die Ergebnisse suchen, priorisierend auf Vertrauen und Transparenz. Entdecken Sie mehr auf der offiziellen Website.

  32. Gregoryflazy Gregoryflazy

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

  33. Donaldmuh Donaldmuh

    В данной статье рассматриваются проблемы общественного здоровья и социальные факторы, влияющие на него. Мы акцентируем внимание на значении профилактики и осведомленности в защите здоровья на уровне общества. Читатели смогут узнать о новых инициативах и программах, направленных на улучшение здоровья населения.
    Обратиться к источнику – [url=https://old-lekar.com/chto-takoe-sit-kodirovanie/]clinica plus в твери[/url]

Leave a Reply

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