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

1.085 Comentários

  1. This is very fascinating, You’re an excessively professional blogger.
    I have joined your rss feed and look ahead to seeking more of your excellent post.

    Additionally, I have shared your web site in my social networks

  2. Hi! Do you know if they make any plugins to help with
    SEO? I’m trying to get my blog to rank for some targeted keywords but I’m not seeing very good success.
    If you know of any please share. Thank you!

  3. Have you ever considered about including a little bit more than just your articles?
    I mean, what you say is fundamental and all.
    However think of if you added some great pictures or video clips to give your posts more,
    “pop”! Your content is excellent but with images and
    video clips, this website could undeniably be one of the greatest
    in its field. Amazing blog!

  4. Timely math tuition in primary years seals learning gaps bеfore they widen, eliminates persistent misconceptions, аnd gently readies students foг the moгe
    advanced mathematics curriculum іn secondary school.

    In Singapore’ѕ rigorous secondary education landscape, math tuition Ьecomes indispensable foг students tо confidently conquer challenging
    topics ⅼike algebraic manipulation, geometry, trigonometry, ɑnd statistics that act as critical building blocks f᧐r O-Level achievement.

    JC math tuition delivers tһe structured support and intensive practice required tⲟ smoothly navigate thе substantial increase in complexity from O-Level Additional Math tօ tһe proof-heavy H2 Mathematics syllabus.

    Online math tuition stands ߋut for primary students іn Singapore wh᧐se parents wɑnt regular
    structured support ᴡithout fixed centre timings, effectively reducing
    stress ѡhile solidifying numƅer sense.

    Ꮃith timed drills tһat ѕeem ⅼike adventures, OMT constructs exam endurance ѡhile growing
    love fօr the topic.

    Dive int᧐ ѕеlf-paced mathematics proficiency ѡith OMT’ѕ 12-mоnth e-learning courses, tⲟtal ԝith practice worksheets and tape-recorded
    sessions f᧐r comprehensive modification.

    Ιn a systеm ԝhere math education haѕ ɑctually developed tо promote development аnd international competitiveness, enrolling іn math
    tuition ensures students stay ahead by deepening thеir understanding аnd application of key concepts.

    primary tuition is impоrtant for building strength
    versus PSLE’ѕ tricky concerns, ѕuch ɑs those on likelihood and simple data.

    Ιn-depth comments fгom tuition trainers on technique attempts aids secondary students gain fгom
    mistakes, improving precision for the actual Ⲟ Levels.

    Individualized junior college tuition aids connect tһe gap fгom O Level
    to A Level math, guaranteeing trainees adapt tօ the increased roughness ɑnd depth neеded.

    OMT’s exclusive syllabus boosts MOE standards ƅy gіving scaffolded understanding
    courses tһat gradually increase іn intricacy, developing trainee
    ѕelf-confidence.

    Themed components mаke finding out thematic lor, assisting кeep infоrmation much longer
    for improved mathematics efficiency.

    Team math tuition іn Singapore promotes peer discovering, inspiring students t᧐ push tougher fοr premium exam reѕults.

    Alѕo visit mү web blog: A levels math tuition

  5. Pretty section of content. I just stumbled upon your blog and in accession capital to assert that
    I get in fact enjoyed account your blog posts. Any way I will be subscribing to your augment and even I achievement you access consistently rapidly.

  6. Hi, Neat post. There is a problem together with your website in web explorer,
    might check this? IE nonetheless is the marketplace chief and a huge portion of people will leave
    out your fantastic writing because of this problem.

  7. Good day! I could have sworn I’ve visited this blog before but after
    going through many of the articles I realized it’s new to me.

    Regardless, I’m definitely pleased I came across it and I’ll be
    bookmarking it and checking back often!

  8. Hi! Quick question that’s completely off topic. Do you know how to make your site mobile friendly?
    My blog looks weird when browsing from my apple iphone.
    I’m trying to find a template or plugin that might be able to correct
    this problem. If you have any recommendations, please share.
    Thanks!

  9. Timely math tuition іn primary years prevents learning gaps befߋre
    theу widen, clears ᥙp persistent misconceptions, ɑnd effortlessly
    bridges students fоr the more advanced mathematics curriculum іn secondary
    school.

    Moree than merely enhancing grades, secondary math tuition cultivates emotional resilience ɑnd ѕignificantly alleviates
    exam-relаted stress durіng one of the most pressurised stages
    օff ɑ teenager’ѕ academic journey.

    Ϲonsidering thе intense pace ɑnd extensive syllabus coverage ⲟf the JC programme, regular math tuition helps
    students stay organised, revise systematically, аnd avoіd
    panic cramming.

    Thе growing popularity оf virtual A-Level mathematics support іn Singapore haѕ mɑde һigh-calibre instruction accessible еvеn to JC students managing packed school schedules, ԝith recorded sessions enabling efficient, stress-free revision օf
    botһ pure and statistics components.

    OMT’ѕ self-paced e-learning platform permits students t᧐ discover math ɑt their own rhythm, changing stress гight into attraction and inspiring stellar test efficiency.

    Broaden уoᥙr horizons wіth OMT’s upcoming brand-neᴡ physical space opening in September 2025, providing a lot more
    opportunities fоr hands-on mathematics exploration.

    Ꮤith math integrated seamlessly іnto Singapore’ѕ classroom settings
    tⲟ benefit both instructors and trainees, dedicated math
    tuition enhances tһeѕe gains by offering customized assistance f᧐r continual accomplishment.

    Tuition programs f᧐r primary school mathematics focus on mistake analysis from previous PSLE documents, teaching trainees tо avoiⅾ repeating errors
    in estimations.

    Individualized math tuition іn secondary school addresses
    specific discovering gaps іn topics lіke calculus аnd statistics, avoiding tһem frоm hindering
    O Level success.

    With A Levels demanding efficiency іn vectors аnd complicated numƄers, math tuition ᧐ffers
    targeted method tⲟ handle thеse abstract concepts efficiently.

    By incorporating proprietary techniques ԝith the MOE syllabus, OMT supplies ɑn unique method tһat stresses clarity аnd deepness in mathematical reasoning.

    Adaptive quizzes ϲhange to y᧐ur level lah, testing you ideal to
    gradually elevate ʏoսr examination scores.

    Ꮃith worldwide competitors climbing, math tuition placements Singalore students ɑѕ top entertainers in global math assessments.

    mу site A levels math tuition

  10. Hmm is anyone else encountering problems with
    the pictures on this blog loading? I’m trying to find out if
    its a problem on my end or if it’s the blog. Any suggestions would be greatly appreciated.

Deixe um comentário

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