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.852 Comentários

  1. Thanks for ones marvelous posting! I quite enjoyed reading it, you’re a great author.
    I will be sure to bookmark your blog and will often come back very soon. I want to encourage yourself to
    continue your great posts, have a nice day!

  2. Please let me know if you’re looking for a article writer for your
    blog. You have some really great posts and I think I would be a good asset.
    If you ever want to take some of the load off, I’d absolutely love to write some content for your blog in exchange
    for a link back to mine. Please shoot me an e-mail if interested.
    Kudos!

  3. Hi my family member! I wish to say that this post is awesome, great
    written and come with approximately all significant infos.
    I’d like to look extra posts like this .

  4. I’ve got to be honest, but the day I stepped into the backend of the sports world, everything I
    thought I knew about modern sports completely collapsed.

    I always believed sports were about competition, but when I saw how the
    entire industry had turned into this massive digital economy, I honestly felt overwhelmed.

    What hit me hardest was realizing that cybercriminals weren’t going after “IT servers” anymore.
    They were attacking everything — streaming systems. One breach,
    and millions could be lost instantly.

    And the scariest part?
    I saw it with my own eyes.

    One day, during a routine check, someone mentioned how a
    ransomware attack almost froze an entire club. That was the moment I understood how thin the line
    really is between order and total digital disaster.

    But the real shock came when I looked deeper into betting platforms.

    I swear, I always thought they were just websites.

    But no.
    They are ultra-sensitive digital ecosystems. One tiny
    manipulation can shift odds globally or make
    entire markets react like they’re on fire.

    When I learned how seriously regulated environments handle security — especially the kind you see described in official
    breakdowns — it opened my eyes. If anyone wants to understand how this
    level of protection actually works, they can always look it up directly from the
    source. The full explanations are there, and they’re honestly worth reading.

    Inside the clubs, it was even more surreal.
    I saw databases full of biometric performance metrics — things that could ruin a
    season if leaked.

    And yet the biggest weakness wasn’t the firewalls.

    It was the people.
    One emotional click, one careless moment, and the whole system
    can fall apart. I watched entire staff units go through security training because phishing had
    become a daily threat.

    Compliance teams were everywhere too — checking access, reviewing
    logs, forcing documentation. I used to think
    compliance was boring, but now I understand
    that without it, the entire digital side of
    sports would melt into chaos.

    And the future… that’s another story.
    AI detection, automated response systems, cloud architectures — it
    felt like watching the digital version of an arms race.
    But the truth I walked away with was simple:

    Cybersecurity isn’t some extra cost. It’s the only thing holding this whole world together.

    And honestly, after everything I saw, I can say the system I was reviewing really did an exceptional job.
    They handled their mission far better than I expected.

    If anyone wants to dig deeper or understand how these structures really work, I’d definitely suggest getting more information directly from the
    source. It’s all publicly explained — and believe me,
    once you read it, you’ll never look at sports or betting the
    same way again.

  5. Howdy! Would you mind if I share your blog with my twitter
    group? There’s a lot of people that I think would really appreciate your content.
    Please let me know. Cheers

  6. I’ll never forget this, but the moment I started helping
    a friend inside a major sports organization, everything
    I thought I knew about modern sports completely collapsed.

    I always believed sports were about competition, but when I saw how the entire industry had turned into this multi-layered financial machine, I honestly felt
    overwhelmed.

    What hit me hardest was realizing that cybercriminals weren’t going after “IT
    servers” anymore. They were attacking everything — contract files.
    One breach, and millions could be lost instantly.

    And the scariest part?
    I saw it with my own eyes.

    One day, during a routine check, someone mentioned how a ransomware attack
    almost froze an entire club. That was the moment I understood how thin the line really
    is between order and total digital disaster.

    But the real shock came when I looked deeper into betting
    platforms.
    I swear, I always thought they were just websites.

    But no.
    They are ultra-sensitive digital ecosystems.
    One tiny manipulation can shift odds globally or make entire markets react like they’re on fire.

    When I learned how seriously regulated environments handle security — especially
    the kind you see described in official breakdowns — it opened my eyes.

    If anyone wants to understand how this level of protection actually works, they can always
    look it up directly from the source. The full explanations are there, and they’re honestly worth reading.

    Inside the clubs, it was even more surreal. I saw databases full of tactical plans — things that could ruin a season if leaked.

    And yet the biggest weakness wasn’t the firewalls.

    It was the people.
    One emotional click, one careless moment, and the whole system can fall apart.
    I watched entire staff units go through security training because phishing had become a daily threat.

    Compliance teams were everywhere too — checking access,
    reviewing logs, forcing documentation. I used to think compliance was boring, but now I understand that without
    it, the entire digital side of sports would melt
    into chaos.

    And the future… that’s another story.
    AI detection, automated response systems, cloud architectures — it felt like watching the digital version of an arms race.
    But the truth I walked away with was simple:

    Cybersecurity isn’t some extra cost. It’s the only thing holding this whole
    world together.

    And honestly, after everything I saw, I can say the system I was reviewing really did an exceptional job.

    They handled their mission far better than I expected.

    If anyone wants to dig deeper or understand how
    these structures really work, I’d definitely suggest getting more information directly from the source.
    It’s all publicly explained — and believe me,
    once you read it, you’ll never look at sports or betting the same way
    again.

  7. Hi there, There’s no doubt that your website could possibly be having web browser compatibility issues.
    When I look at your web site in Safari, it looks fine however when opening in IE,
    it has some overlapping issues. I simply wanted to provide
    you with a quick heads up! Besides that, wonderful blog!

  8. Every weekend i used to pay a quick visit this web page, as i want
    enjoyment, as this this site conations genuinely fastidious funny information too.

  9. If some one needs to be updated with hottest technologies afterward he must be pay a visit this
    website and be up to date all the time.

    my blog singapore online casino free credit (Felipe)

  10. Hi this is somewhat of off topic but I was wondering if blogs use WYSIWYG editors
    or if you have to manually code with HTML. I’m starting a blog
    soon but have no coding skills so I wanted to get advice from
    someone with experience. Any help would be greatly appreciated!

    Also visit my web site; aztec temple casino game (Stephaine)

  11. free online slots nz, best paying pokies united kingdom and usa free bingo prize, or uk bingo

    my web blog gambling economy benefits (Alphonse)

  12. Hi, I’m a big fan of your site! I am currently researching more information on gold name necklace and your article is
    the best I’ve found. I especially love personalized jewelry and your style is perfect.
    Looking forward to your next update! Best, Jamel.

  13. Hello i am kavin, its my first time to commenting anyplace, when i read this paragraph i thought i could also create comment
    due to this sensible paragraph.

  14. Howdy, I think your blog might be having web browser compatibility problems.

    Whenever I take a look at your site in Safari, it looks fine but when opening in IE, it’s got some overlapping issues.

    I simply wanted to give you a quick heads up! Other than that, great site!

  15. Singapore’s consistent top rankings in global assessments sսch as TIMSS/PISA
    һave made supplementary primary math tuiition practically routine ɑmong families aiming
    to maintain tһat ԝorld-class standard.

    Numerous Singapore parents choose secondary-level math tuition tօo
    ensure their children remain ahead in an environment ᴡheгe future subject combinations ɑгe strongly influenced by mathematics resuⅼts.

    For JC students struggling ѡith tһe transition tο autonomous academic study, оr
    those aiming to moνe from solid tо outstanding, math tuition provides tһe critical edge needeɗ to excel in Singapore’s highly meritocratic
    post-secondary environment.

    Іn Singapore’ѕ faѕt-paced ɑnd highly competitive education ѕystem, online math tuition һas emerged as a game-changing
    solution fօr primary students, offering flexible scheduling ɑnd personalised ᧐ne-to-one guidance tߋ helⲣ
    young learners thⲟroughly understand foundational PSLE topics ⅼike
    fractions, ratios and speed-distance ρroblems from һome without rigid centre schedules.

    OMT’ѕ multimedia sources, ⅼike engaging
    video clips, make math cߋme active, aiding Singapore pupils fаll passionately crazy
    ԝith it for exam success.

    Unlock үouг child’s comⲣlete potential in mathematics ᴡith OMT
    Math Tuition’s expert-led classes, customized tօ Singapore’s
    MOE curriculum f᧐r primary school, secondary, and JC students.

    Ιn а sʏstem where math education hɑs ɑctually developed to foster innovation аnd global
    competitiveness, enrolling іn math tuition guarantees trainees
    stay ahead ƅy deepening their understanding andd application ߋf crucial concepts.

    Enrolling іn primary school school math tuition еarly fosters confidence, reducing anxiety fߋr PSLE takers ѡһo face high-stakes questions on speed, distance, ɑnd time.

    Linking math principles tߋ real-wоrld situations νia tuition grows
    understanding, mаking O Level application-based concerns extra approachable.

    Junior college math tuition іs crucial for A Levels as
    it deepens understanding ⲟf sophisticated calculus subjects ⅼike combination techniques аnd differential
    equations, ԝhich аre main to tһe exam curriculum.

    Unlіke common tuition centers, OMT’ѕ custom-maԁe
    syllabus enhances the MOE framework Ƅy including real-world applications, maкing abstract mathematics
    principles mоre relatable ɑnd easy to understand foг students.

    OMT’s system is mobile-friendly ᧐ne, so examine օn the move and see ү᧐ur mathematics grades enhance ԝithout missing ɑ beat.

    Math tuition develops strength in facing challenging concerns,
    а necessity fօr growing іn Singapore’ѕ high-pressure exam setting.

    Also visit my һomepage :: singapore online tuition

  16. Ищешь кран? кран под приварку для трубопроводов различного назначения. Надежная запорная арматура для систем водоснабжения, отопления, газа и промышленных магистралей. Высокая герметичность, долговечность и устойчивость к нагрузкам.

  17. Good day I am so excited I found your web site, I
    really found you by accident, while I was researching on Bing
    for something else, Anyhow I am here now and would just like to say thank you for a marvelous post and a all
    round exciting blog (I also love the theme/design), I don’t have time
    to go through it all at the moment but I have book-marked it and also added your
    RSS feeds, so when I have time I will be back to read a lot
    more, Please do keep up the superb work.

Deixe um comentário

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