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

5,054 Comments

  1. Помощь 24/7 означает, что нарколог на дом в Хабаровске может быть направлен в любое время суток, включая ночные часы и выходные дни. В клинике «Ясный Вектор» выездная служба функционирует с учётом логистики города, что позволяет минимизировать время ожидания врача.
    Подробнее – [url=https://narkolog-na-dom-khabarovsk0.ru/]нарколог на дом клиника хабаровск[/url]

  2. Helpful info. Fortunate me I found your website unintentionally, and
    I’m shocked why this twist of fate didn’t took place earlier!
    I bookmarked it.

  3. Consistent primary math tuition helps young learners conquer
    common challenges including heuristic techniques аnd rapid calculation skills,
    which аrе prominently featured іn school examinations.

    Numerous Singapore parents invest іn secondary-level math tuition to ensure tһeir children гemain ahead iin аn environment ԝһere future subject combinations ɑre strongⅼy influenced Ьү mathematics results.

    Consideгing the intense pace and substantial curriculum breadth ᧐f
    tһe JC programme, regular math tuition helps
    students кeep pace efficiently, review productively, аnd eliminate
    eleventh-һoսr rush.

    Across primary, secondary аnd junior college levels, virtual mathematics support һaѕ revolutionised education bу combining unmatched convenience ԝith cost-effectiveness ɑnd availability օf expert guidance, helping students stay ahead іn Singapore’ѕ intensely competitive
    academic landscape ѡhile preventing exhaustion fгom lօng travel or inflexible schedules.

    OMT’ѕ mindfulness techniques minimize mathematics stress
    аnd anxiety, permitting genuine affection tо grow and motivate test quality.

    Founded іn 2013 Ƅy Mr. Justin Tan, OMT Math Tuition һas actᥙally assisted many students ace exams ⅼike
    PSLE, O-Levels, ɑnd A-Levels with tested analytical techniques.

    Ιn a ѕystem where mathematics education һɑs actuaⅼly
    developed tο cultivate innovation ɑnd global competitiveness, registering іn math tuition makes sսre trainees stay ahead Ьy deepening tһeir understanding аnd application оf crucial concepts.

    Math tuition assists primary trainees master PSLE ƅy enhancing the Singapore
    Math curriculum’ѕ bar modeling method f᧐r visual analytical.

    Ӏn Singapore’s affordable education and learning landscape,
    secondary math tuition ɡives tһe extra edge required tⲟ stand apɑrt in Ο Level positions.

    Wіtһ routine mock examinations ɑnd comprehensive feedback, tuition helps
    junior university student identify аnd correct weaknesses
    prior tо the actual Ꭺ Levels.

    OMT sets itѕеlf apart witһ an educational program tһаt improves MOE syllabus ᴠia collaborative on-ⅼine forums for reviewing exclusive
    mathematics challenges.

    Professional pointers іn videos give faster wаys
    lah, assisting yoս fix questions quicker ɑnd rack up moгe in examinations.

    Singapore’ѕ concentrate оn holistic education is complemented bү math tuition tһat
    develops abstract thought foг l᧐ng-lasting exam benefits.

    Αlso visit my hߋmepage; online math tuition Singapore innovative

  4. It’s remarkable to visit this website and reading the
    views of all friends concerning this paragraph,
    while I am also keen of getting familiarity.

  5. RobertJor RobertJor

    Этот текст содержит различную информацию, которая, возможно, покажется любопытной, но в целом не меняет восприятия привычных вещей. Предлагаем просто получить удовольствие от чтения, не ожидая особой пользы.
    Вот – [url=https://arma-rehab.ru/]скидки[/url]

  6. I love what you guys are usually up too. This sort of clever work and coverage!
    Keep up the very good works guys I’ve incorporated you
    guys to my personal blogroll.

  7. Craignop Craignop

    Комплексная терапия — это сочетание медицинских и психологических шагов, которые решают разные задачи. Медицинская часть помогает пройти острый период и восстановить управляемость состояния. Психологическая и реабилитационная части помогают не вернуться к прежним сценариям, когда стресс, конфликт или бессонная ночь снова толкают к алкоголю.
    Узнать больше – [url=https://lechenie-alkogolizma-sergiev-posad12.ru/]centr-lecheniya-alkogolizma[/url]

  8. Когда зависимость начинает диктовать настроение, сон и решения, человеку обычно нужно не «поговорить о силе воли», а получить понятную медицинскую помощь: оценку состояния, безопасную стабилизацию и план лечения, который снижает риск повторного ухудшения. В реальности обращаются по разным поводам: затяжной запой, тяжёлая абстиненция, приступы тревоги и бессонницы после прекращения употребления, срыв на фоне стресса, проблемы с контролем дозы или ситуации, когда близкие уже видят явное ухудшение и не понимают, как действовать. Наркологическая клиника в Пушкино — это формат, где помощь организована по шагам: сначала снимают острые риски, затем восстанавливают сон и базовую физиологию, после чего переходят к лечению зависимости как процесса, а не разовой процедуры. Такой подход важен потому, что кратковременное облегчение без дальнейшей работы часто заканчивается возвращением к употреблению в первые недели, когда нервная система ещё нестабильна.
    Получить дополнительную информацию – https://narkologicheskaya-klinika-pushkino12.ru/narkologicheskaya-klinika-otzyvy-v-pushkino/

  9. I feel that is one of the so much significant information for me.
    And i’m satisfied studying your article. However wanna
    statement on few common things, The site taste is great, the articles is in reality great : D.
    Just right process, cheers

  10. I every time spent my half an hour to read this weblog’s posts all the
    time along with a mug of coffee.

  11. Danielheemi Danielheemi

    Участие в государственных и коммерческих процедурах требует точной подготовки, понимания законодательства и внимательной работы с документами. Для многих компаний самостоятельная работа с закупками становится сложной задачей: необходимо отслеживать новые закупки, анализировать требования, оформлять документы и взаимодействовать с площадками.
    Все ответы на ваши вопросы – http://tendernoe-soprovozhdenie-rostov-na-donu.ru

  12. школы дистанционного обучения [url=https://shkola-onlajn-43.ru/]школы дистанционного обучения[/url] .

  13. KevinNer KevinNer

    Ключевой критерий правильного выбора — способность обеспечить контроль динамики. Если состояние нестабильное, симптомы нарастают волнами, есть риск резкого ухудшения ночью или уже наблюдаются опасные признаки (например, выраженная спутанность сознания, судороги, боли в груди, нарушения дыхания), безопаснее стационар. Если риски умеренные, пациент контактный и способен соблюдать рекомендации, возможна выездная помощь и дальнейшее наблюдение по плану.
    Подробнее можно узнать тут – http://narkologicheskaya-klinika-pushkino12.ru/

  14. Craignop Craignop

    Алкоголизм редко начинается как «большая проблема». Обычно всё выглядит как способ расслабиться, заснуть, снять тревогу или пережить стресс. Но постепенно организм привыкает, толерантность растёт, без алкоголя становится тяжело, а попытки «просто перестать» упираются в отмену: дрожь, потливость, тошнота, скачки давления, сердцебиение, раздражительность, панические реакции, бессонница. На этом фоне человек возвращается к выпивке не ради удовольствия, а ради прекращения мучительных симптомов. Именно так формируется замкнутый круг, в котором зависимость поддерживается страхом отмены и привычкой снимать дискомфорт быстрым способом.
    Получить дополнительные сведения – http://lechenie-alkogolizma-sergiev-posad12.ru

Leave a Reply

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