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

15.190 Comentários

  1. remote gambling usa license, usa visa slots availability in hyderabad 2021 and online nba 2k20
    casino trailer (Celeste) real money
    canada, or online casinos usa friendly

  2. real money united statesn online casino, bonauka gambling
    machine and usa gambling regulation changes,
    or 21 dusaes casino login

    Take a look at my web site … roulette significado frances, Randell,

  3. is gambling allowed in united states, roulette layout usa
    and no deposit bonus codes australia casino, or 2021 no
    deposit bonus codes uk

    Visit my webpage; online betting free spins,
    Carri,

  4. free online slots new zealand, bingo online play usa and canada online
    gambling on cape cod (Jennie) laws, or how to
    play united statesn poker

  5. canadian casino guide blackjack chart, no wagering bonus casino united states
    and largest casino in australia 2021, or united statesn casino
    free bonus codes

    Also visit my homepage :: best mobile gambling stocks (Noella)

  6. best new zealand casino, new zealandn original slot online free and dollar 1 deposit casino new zealand,
    or native united statesn casinos in montana

    Feel free to visit my blog post dream of winning money gambling (Lasonya)

  7. new zealandn poker 2 free game, canadian online pokies free spins and wizard of oz
    casino free coins (Allan) in milwaukee wisconsin, or
    new zealandn online gambling sites

  8. gambling in canada statistics, free $25 online bingo australia and casino bonus usa, or olg online casino australia

    Here is my site :: is blackjack rigged (Shelton)

  9. fast withdrawal casino usa 2021, canadian online casino no deposit 7 spins bonus codes 2022 (Hildred) codes and
    betway poker australia, or are casinos legal in australia

  10. Нержавеющая стальная лента — один из самых популярных видов стального проката в современной промышленности. Производство ведётся из нержавеющих марок стали, например AISI 316, AISI 304, 12Х18Н10Т и ряда других марок.

    Основные характеристики нержавеющей ленты: отличная коррозионная стойкость, механическая прочность, пластичность и продолжительный срок службы. Толщина полосы обычно составляет от 0,05 до 2,0 мм, а ширина — от 5 до 400 мм в зависимости от назначения.

    Область применения в пищевой промышленности, в химическом машиностроении, в строительстве, в автомобильной промышленности и в медицине. Помимо этого ленту из нержавейки активно задействуют для производства пружинных элементов, крепёжных хомутов, уплотнительных прокладок и элементов декора.

    Подбирая ленту из нержавеющей стали важно учитывать конкретную марку, термическое состояние (холоднокатаная или отожжённая), допуски по толщине и состояние поверхности (матовая или полированная).

    Ознакомиться с ассортиментом и условиях поставки вы можете на сайте [url=https://nerzhavejushhaja-lenta.ru/kupit]лента нержавеющая купить[/url] — тут размещён полный каталог нержавеющей ленты с описанием и доставкой по России.

  11. game apps to win real money canada, best australian online casinos and free admiral casino
    online pl (Clark) pokies win real money united kingdom, or new no deposit free spins uk 2021

  12. casino game internet uk, bingo online play usa and new zealandn gambling
    habits, or free united statesn slot machine games

    Look at my blog :: vegas roulette odds payout (Elliot)

Deixe um comentário

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