Close Server Console through DOS prompt

I'd like to be able to gracefully bring down the Domino Server through a bat program (or whatever) after the UPS has turned on. In other words when the PC server (windows 2003) loses power for x minutes I can have the UPS issue a DOS command. I would like to have it properly bring down Lotus.
apaclarkAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oBdACommented:
The basic command you need is "net stop <service name>"
To find the correct service name to stop, open a command prompt on the Notes server, enter
net start
This will show a list of running services.
Find the one for Domino, then use this name in the "net stop" command; if the name contains spaces, enclose it in quotes, like this (assuming "Domino Server" as service name):
net stop "Domino Server"
0
apaclarkAuthor Commented:
Yes, but isn't that the same as "X"ing out the window? I was looking for something that would end it in the sameway that "exit" would but issued outside of the console itself as the UPS software can only run windows commands.
0
oBdACommented:
Stopping the service will bring down the Notes service gracefully; I've implemented this before. A service is programmed to be stopped that way, stopping a service is not the same as killing it in Task Manager. When you're stopping the Notes service through "net stop" or services.msc, the SCM will tell the service to stop, which, in all likelihood, will run the exact same procedure as if you would type in "exit" in the console.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Protecting & Securing Your Critical Data

Considering 93 percent of companies file for bankruptcy within 12 months of a disaster that blocked access to their data for 10 days or more, planning for the worst is just smart business. Learn how Acronis Backup integrates security at every stage

SysExpertCommented:
1) You have to make sure that the Domino  server is running as a service.

2) Test your Net stop  command manually to make sure it works.

Newer servers use longer names

net stop "lotus (notesdata)"

You made need the quote marks for any service name  wth spaces.

The name should be taken from the Service in Windows !

I hope this helps !
0
apaclarkAuthor Commented:
Excellent! Thanks
0
LotusDaveCommented:
But you can always issue console commands through dos using nserver.
At the dos prompt navigate to the folder containing the notes executables, say c:\notes.
Then issue the command Nserver -q
Which issues a q command to the console.
So the batch file would contain

cd c:\notes
nserver -q

0
apaclarkAuthor Commented:
Nice! I like that even better as we are not always in the habit of running the server as a service. This should work regardless of the startup method.
0
LotusDaveCommented:
Yes, it does work whether the server is running as a service or as an application.
Sometimes one or two threads might get stuck so I usually sleep for a couple of minutes then used nds to kill any threads that have not closed gracefully -

cd c:\notes
nserver -q
sleep 120
nsd -kill

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Lotus IBM

From novice to tech pro — start learning today.