Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 59585
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T18:01:42+00:00 2026-05-10T18:01:42+00:00

I have a problem with stopping a service and starting it again and want

  • 0

I have a problem with stopping a service and starting it again and want to be notified when the process runs and let me know what the result is.

Here’s the scenario, I have a text file output of an ‘sc’ command. I want to send that file but not as an attachment. Also, I want to see the initial status quickly in the subject of the email.

Here’s the ‘servstop.txt’ file contents:

[SC] StartService FAILED 1058:

The service cannot be started, either because it is disabled or because it has no enabled devices associated with it.

I want the subject of the email to be ‘Alert Service Start: [SC] StartService FAILED 1058’ and the body to contain the entire error message above.

I will put my current method in an answer below using a program called blat to send me the result.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T18:01:43+00:00Added an answer on May 10, 2026 at 6:01 pm

    Here’s how I’m doing this. First I got blat mail (public domain smtp mailer) and dropped it into d:\blat directory. My Exchange server allows me to email without id/password and just assumes that I am the person in the ‘from’ field of the blat command.

    @echo off sc start Alerter >servstop.txt SetLocal EnableDelayedExpansion set content= set subj= for /F 'delims=' %%i in (servstop.txt) do set content=!content! %%i   for /f 'tokens=1 delims=:' %%s in ('%content%') do set subj=%%s   d:\blat\blat.exe -body '%content%' -to my-email@foo.bar -f my-email@foo.bar -server smtp.foo.bar -s 'Alert Service Start:%subj% ' -log d:\blat\blat.log EndLocal 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have big problems with stopping a service, which plays audio file. I want
I have one service that simply is for starting and stopping another service I
i have a problem with the stopping of a windows phone xna game. i
I seem to have the exact opposite problem than this question on stopping dock
I have defined the following service with an observer of messages sent. The problem
I have problem installing simple Windows Service, my code looks like this: using System;
I have designed a windows service in C#, which runs continiously and spawns three
Problem I have an MSI that creates and starts a Windows service during installation
I have an existing .net service, and I want to configure it to write
I have written a service which starts a java.exe or ruby.exe (I know there

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.