Solved

Service.msc

Posted on 2014-12-12
7
153 Views
Last Modified: 2014-12-15
Services.mscI have MAPILabPOP3 Connector service running in my Services.msc on SBS2011.
This service stops running once in a while on its own and sometime when the server restarts, it does not run. So in both occasions, I have to start that service manually from time to time.

Two things I like to accomplish:
(1) Start this service as the file server restarts. Because sometimes it starts automatically and sometime it does not. So I like to give it one more push every time the file server restarts.
(2) I like to be able to check to see if it is running daily. If it is not running, I like to run my batch file "Start_MAPIPOP3.bat" which has the command "Net Start MAPILabPOP3Connector"
How can I write a script in a batch file (.bat) so that I can schedule these to run at scheduled times?
0
Comment
Question by:sglee
7 Comments
 
LVL 14

Accepted Solution

by:
Michael Dyer earned 125 total points
ID: 40497368
Why not just schedule the batch file with the Net Start command to run daily - if the service is already running it will just reply that it is already started.  No need to check anything.  Just be sure that you put this in the scheduler with administrator credentials so the scheduled event has the rights to start a service.
0
 
LVL 37

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 250 total points
ID: 40497381
>> (1) Start this service as the file server restarts.
Try setting the Startup Type to Automatic (Delayed ...) and see if that helps.
0
 

Author Comment

by:sglee
ID: 40497485
So if the service is already running and if I run NET START command once a day in taskschd,  it won't do any harm?

If that is the case, then I will simply schedule it to run once a day and create another one to run Auto Delayed as suggested.
0
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

 
LVL 24

Assisted Solution

by:Lionel MM
Lionel MM earned 125 total points
ID: 40497906
The suggestion above about auto delayed is meant to change the properties of the service itself in Services, there is a choice to say either Automatic or Automatic delayed and yes if you try to start a service that is already started it won't hurt anything it will just indicate that it is already started.
0
 

Author Comment

by:sglee
ID: 40497912
$lion
Yes that is how I understood their comments.
0
 
LVL 37

Assisted Solution

by:Gerwin Jansen, EE MVE
Gerwin Jansen, EE MVE earned 250 total points
ID: 40497927
I would do "sc start <servicename>" btw, as said trying to start if it were running is OK, it just says:
C:\WINDOWS\system32>sc start wsearch
[SC] StartService FAILED 1056:

An instance of the service is already running.

Open in new window

If you want to check whether it is running:

C:\WINDOWS\system32>sc query wsearch

SERVICE_NAME: wsearch
        TYPE               : 10  WIN32_OWN_PROCESS
        STATE              : 4  RUNNING
                                (STOPPABLE, NOT_PAUSABLE, ACCEPTS_SHUTDOWN)
        WIN32_EXIT_CODE    : 0  (0x0)
        SERVICE_EXIT_CODE  : 0  (0x0)
        CHECKPOINT         : 0x0
        WAIT_HINT          : 0x0

C:\WINDOWS\system32>sc query wsearch | findstr /i running
        STATE              : 4  RUNNING

Open in new window

0
 

Author Comment

by:sglee
ID: 40499008
Thanks everyone for your help.
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A procedure for exporting installed hotfix details of remote computers using powershell
A safe way to clean winsxs folder from your windows server 2008 R2 editions
This tutorial will give a short introduction and overview of Backup Exec 2012 and how to navigate and perform basic functions. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as conne…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question