How to shutdown when at login prompt

J

JeffB

We need to automatically shut down a Win2000 server once a month. Don't have
'official' MS shutdown.exe, but am trying to use a couple third-party apps.
Trouble is, they only run if logged into the server.

Is there any way to do this? With the MS shutdown.exe? And how can I get
that? MS says it's on the Win2000 Resource disk, which I don't have and it
appears you can no longer get.

tia
 
P

Pegasus \(MVP\)

JeffB said:
We need to automatically shut down a Win2000 server once a month. Don't
have
'official' MS shutdown.exe, but am trying to use a couple third-party
apps.
Trouble is, they only run if logged into the server.

Is there any way to do this? With the MS shutdown.exe? And how can I get
that? MS says it's on the Win2000 Resource disk, which I don't have and
it
appears you can no longer get.

tia

All third-party shutdown commands I've used work in the same way as the
native shutdown.exe command, provided you have sufficient privileges to shut
down the machine. I recommend you do this:

- Log on to the server.
- Put the following lines into c:\Windows\MyShutdown.bat:
@echo off
echo %date% %time% %UserName% >> c:\MyShutdown.log
c:\shutdown.exe /.. /.. 1>> c:\MyShutdown.log 2>>&1
- Open a Command Prompt.
- Run c:\Windows\MyShutdown.bat
- After the reboot use notepad.exe to examine c:\MyShutdown.log
- Use the Task Scheduler to schedule c:\Windows\MySchutdown.bat
to run once a month.
- Right-click the task you created just now, then click Run.
- If the server reboots, fine, problem solved. If it does not, use
notepad.exe
to examine c:\MyShutdown.log

I expect that all will be crystal-clear after this little exercise.

By the way - be careful when rebooting servers automatically. Your
accountant might have a few terse words for you if he loses his files while
he was working at 2am to prepare the annual financial statements.
 
J

JeffB

thanks for the reply

This server is a stand-alone used for a real basic app. No AD or anything.

When logged in as Administrator it works fine. But if I set up a scheduled
job to run (same .bat) and logout, it will not run.

The scheduled job is set to run as Adminsitrator also, with password supplied.

Is MS shutdown.exe available anywhere?

I'll also run the .bat you suggested and post results.
 
J

JeffB

I ran the scrip, but couldn't get the second part to run correctly
(c:\shutdown.exe /.. /.. 1>> c:\MyShutdown.log 2>>&1).

It did show Administrator as the username though.
 
P

Pegasus \(MVP\)

You need to remember that I cannot see your machine. You must therefore post
two items:
1. The batch file you used.
2. The contents of the log file.
Without those it is impossible for me to make any further comments.
 
P

Pegasus \(MVP\)

I suspect that your problem lay elsewhere. If your original shutdown command
worked under the command prompt then it would have worked under a scheduled
task too. Using psshutdown wouldn't have made any difference.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top