Ir ao conteúdo

Verificar se um processo está execução e notificar via e-mail no Windows

Olá,

Recentemente meu primo precisou um Visual Basic Script que verifica se um processo está executando e caso esteja envie um e-mail. Ele me pediu ajuda para criar este script e eu resolvi ajudar.

Visual Basic Script para verificação de processo em execução e notificação via E-mail.

Verificar se um processo está em execução com Visual Basic Script e mostrar uma janela se estiver.
[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]

Enviar e-mail utilizando Visual Basic Script:
[code lang=”vb”]
Const username = “SENHA”
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]

Estes dois scripts foram mesclados para realizar o que precisávamos.

Abraços,
Matheus

Referencias:
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

Publicado emwindows

2.969 Comentários

  1. Donalddurce Donalddurce

    Алкогольная интоксикация оказывает серьёзное влияние на организм, вызывая головную боль, тошноту, слабость и головокружение. Капельница помогает организму быстро избавиться от продуктов распада алкоголя, восстановить нормальное функционирование органов и минимизировать последствия для здоровья. Важно, что мы обеспечиваем полное наблюдение врача на протяжении всей процедуры, что помогает гарантировать безопасность пациента и максимальную эффективность лечения.
    Получить дополнительные сведения – [url=https://kapelnicza-ot-pokhmelya-ekaterinburg-8.ru/]капельница от похмелья вызов на дом екатеринбург[/url]

  2. Have you ever thought about writing an ebook or guest authoring on other sites?
    I have a blog based upon on the same ideas you discuss and would really like to have you share
    some stories/information. I know my audience would enjoy
    your work. If you’re even remotely interested, feel free to shoot me an e mail.

  3. Первые положительные изменения обычно появляются уже через 15–20 минут после начала капельницы. Уменьшается головная боль, снижается чувство тошноты, стабилизируется давление и пульс. К концу процедуры большинство симптомов становится значительно менее выраженными.
    Получить дополнительную информацию – [url=https://kapelnicza-ot-pokhmelya-samara-8.ru/]капельница от похмелья на дому в самаре[/url]

  4. Состав капельницы может варьироваться, однако в большинстве случаев включает базовые группы препаратов, направленные на устранение последствий интоксикации:
    Подробнее тут – [url=https://kapelnicza-ot-pokhmelya-samara-7.ru/]капельница от похмелья анонимно[/url]

  5. Безопасность — это не лозунг, а набор решений. Мы избегаем «жёстких» седативных доз, которые создают видимость улучшения и повышают риск скрытых осложнений. Наращивание темпа инфузии происходит постепенно и увязано с динамикой симптомов и цифрами измерений. Любой шаг объясняется пациенту и семье: зачем он выбран, что считается нормальной волной улучшения, в какой момент нужно связаться с дежурным. Такой прозрачный формат снимает тревогу и помогает всем участникам действовать согласованно.
    Разобраться лучше – http://narkolog-na-dom-ivanteevka8.ru/vyzvat-narkologa-na-dom-v-ivanteevke/https://narkolog-na-dom-ivanteevka8.ru

  6. Goodinidat Goodinidat

    Запой — это не просто временная слабость, а критическое состояние, требующее экстренного медицинского вмешательства. Особенно опасно откладывать обращение за помощью, если у человека наблюдаются такие симптомы:
    Получить больше информации – https://vyvod-iz-zapoya-balashiha5.ru/vyvod-iz-zapoya-kruglosutochno-v-balashihe/

  7. Kennynak Kennynak

    Перед началом процедуры проводится оценка состояния пациента, что позволяет полностью подобрать оптимальный состав терапии. После проведения капельницы пациент может почувствовать значительное облегчение: уйдёт головная боль, улучшится работоспособность, уменьшится ощущение слабости и раздражительности. Важно, что процедура не только снимает симптомы, но и помогает организму избавиться от токсинов и наладить нормальную работу печени, почек и сердечно-сосудистой системы. Подробнее о процедуре и рекомендациях можно читать у специалистов клиники.
    Получить дополнительные сведения – [url=https://kapelnicza-ot-pokhmelya-ekaterinburg-4.ru/]капельница от похмелья вызов на дом в екатеринбурге[/url]

  8. вывести из запоя в стационаре санкт петербург [url=https://vyvod-iz-zapoya-v-staczionare-sankt-peterburg-3.ru/]vyvod-iz-zapoya-v-staczionare-sankt-peterburg-3.ru[/url] .

  9. Roberthor Roberthor

    Когда такие симптомы становятся ярко выраженными, важно не откладывать вызов нарколога. В противном случае токсическое воздействие алкоголя может повлиять на другие органы, такие как печень, почки и сердце, что приведёт к более серьёзным последствиям. Врач на дому проведет экстренную помощь, обеспечит безопасность и поможет избежать ухудшения состояния.
    Детальнее – [url=https://kapelnicza-ot-pokhmelya-samara-2.ru/]капельница от похмелья анонимно в самаре[/url]

  10. Singapore’ѕ consistent toⲣ rankings in global assessments ⅼike TIMSS
    and PISA have maⅾe supplementary primary math tuition ɑlmost standard
    аmong families aiming tо uphold thɑt world-class standard.

    Giѵen the higһ-pressure Օ-Level period, targeted math tuition delivers intensive drill
    ɑnd technique training that can dramatically improve гesults for Seс 1 through Seec 4
    learners.

    Math tuition ɑt junior college level ⲣrovides ttailored assessment and A-Level
    oriented approɑches that ƅig-ɡroup JC tutorials raгely offer in sufficient depth.

    In a city ѡith packed schedules аnd heavy
    traffic, online math tuition enables secondary learners tߋ receive intensive revision support ɑt any convenient time, dramatically improving
    their ability to efficiently handle timed exam scenarios.

    Eventually, OMT’ѕ extensive services weave happiness right into
    mathematics education ɑnd learning, helping students drop
    deeply crazy аnd skyrocket in their tests.

    Expand yoᥙr horizons wіth OMT’s upcoming brand-neԝ physical space
    ᧐pening in September 2025, using even more chances for hands-on mathematics expedition.

    Singapore’ѕ ԝorld-renowned mathematics curriculum stresses conceptual understanding оver mere computation, making math tuition important for trainees tߋ grasp deep ireas аnd excel in national tests ⅼike PSLE and O-Levels.

    Math tuition іn primary school bridges spaces іn class learning,
    ensuring trainees grasp complex subjects ѕuch as geometry and
    data analysis Ƅefore the PSLE.

    Customized math tuition іn secondary school addresses private finding օut spaces
    in subjects lіke calculus and statistics,preventing tһem from preventing
    O Level success.

    In ɑ competitive Singaporean education ѕystem,
    junior college math tuition ցives students tһе sіɗe to achieve higһ qualities needed for
    university admissions.

    OMT establishes іtself apaгt ᴡith ɑ curriculum thɑt boosts MOE
    syllabus using collective օn the internet discussion forums fоr reviewing exclusive mathematics difficulties.

    OMT’ѕ on-line tuition іs kiasu-proof leh, ցiving ʏou that extra
    edge to outmatch іn Ⲟ-Level math exams.

    With math being a core topic tһat affects total scholastic streaming, tuition assists Singapore trainees protect fаr ƅetter grades and brighter future opportunities.

    Ηere is my blog post: math tuition Singapore ACS Barker math

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *