Daily Restart Domino service with batch scripts

Source: Internet
Author: User
Tags exit goto

To mitigate the maintenance effort of the Domino server

Decide to restart the Domino service on a daily basis with batch scripts

The following batch work:

1. Send quit exit instructions to Domino console first

After 2, 30 seconds, check to see if Domin has not exited successfully. If it is successfully launched, proceed to the next step. Otherwise, forcibly shut down the domino process.

After 3, 30 seconds, check to see if the Word template file process exists. If present, the word process is forcibly closed. If it does not exist, continue.

4, the end of the script run.

Add this batch script to the scheduled task to adjust the execution time as needed.

--------------------------------------------------------------------------------------------------------------- ---

@echo off

Echo ********************************************************

Echo Domino Service Restart Batch

echo Hardair @ 2011/08/18/17/19/00

Echo ********************************************************

Echo.

: Checkdomino

Echo detects if Domino process exists ...

Echo.

TASKLIST/NH | find/i "Nserver.exe"

if errorlevel 1 (goto Nofinddomino) Else (goto Killdomino)

: Killdomino

Echo.

Echo detects the domino process, sends an exit command to the Domino console, and waits 30 seconds ...

G:\Lotus\Domino\nserver.exe-c "Quit"

REM Uses ping delay

Ping 127.0.0.1-n > nul

Echo.

Echo forces the Domino service off and waits 30 seconds ...

Echo.

taskkill/f/im Nserver.exe

REM Uses ping delay

Ping 127.0.0.1-n > nul

Goto Checkword

: Nofinddomino

Echo.

Echo did not detect the domino process.

: Checkword

Echo.

Echo detects if Word processes exist ...

Echo.

TASKLIST/NH | find/i "WINWORD.exe"

if errorlevel 1 (goto Nofindword) Else (goto Killdword)

: Killdword

Echo.

Echo detects the word process, forces the word process to close, and waits 30 seconds ...

Echo.

taskkill/f/im WINWORD.exe

REM Uses ping delay

Ping 127.0.0.1-n > nul

Goto END

: Nofindword

Echo.

Echo does not detect the word process.

: End

Echo.

Shutdown–f–r–t 0

Echo.

echo Batch Run complete!

Echo.

REM Pause

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.