Archived from groups: microsoft.public.windowsxp.help_and_support (
More info?)
<tonyboten@yahoo.co.uk> wrote in message
news:1116780489.237701.57900@f14g2000cwb.googlegroups.com...
> Nepatsfan wrote:
>> It just occured to me that naming your batch file shutdown.bat
>> would also cause the problem you're having. Try renaming it
>> something else.
>
> Thanks. The '-m' helped, but only brought me back to the Remote
> Shutdown Dialog. Otherwise 'snafu'. I took all your advice on
> board at
> one fell swoop so I don't know which part of it caused the
> improvement.
>
> Regarding Carey's comment, I have SP2 and automatic updating so
> that's
> not the problem.
>
First off, if you don't want to see the Remote Shutdown dialog,
don't use the -i switch.
Next, I should have picked up on this earlier. You shouldn't
have both the -l and the -s switches included. It's either one or
the other. The -l switch logs off the current user but leaves the
computer running. The -s switch logs off the current user and
shuts down the computer.
Also, is your goal to turn off a local computer or a remote
computer? If you're trying to turn off the local machine, you
don't need to include the -m switch. In other words, if the batch
file resides somewhere on the machine's hard drive, your batch
file should look like this:
shutdown -s -t 60
You would save this file as something like sdlocal.bat.
If you're trying to shutdown a remote computer, your batch file
would be:
shutdown -s -t 60 -m \\remotepc
You would save this file as something like sdremote.bat.
You might want to include the -c switch with a comment warning
the user to close all open applications in order to avoid losing
any data. Just put the comments inside quotation marks, something
like this:
shutdown -s -t 60 -c "Close all open applications in order to
avoid losing data".
Just so you know, it was renaming your batch file that stopped
the command prompt window problem you were having. You had two
files on your computer named shutdown, shutdown.exe and
shutdown.bat. The command prompt window will usually execute
commands without extensions in this order of preference, .com
then .exe then .bat. The exception to this rule is if the
location in which the command prompt window is launched contains
a version
of the file it will run that command. Since your batch file,
shutdown.bat, launched the command prompt window from it's
location and the command inside was simply "shutdown" it got
caught in a loop trying to execute shutdown.bat over and over
again instead of running shutdown.exe. I hope that explains what
happened.
Going back to your original question, keep in mind that if you're
planning on using Scheduled Tasks to run this batch file at a
certain time it will have to be setup using an account that has a
password. The only way around this restriction is to edit the
registry. Take a look here for that procedure:
http://www.kellys-korner-xp.com/xp_s.htm
Scroll down to this heading, "Scheduled Tasks - Applying/Running
tasks without a password".
Good luck
Nepatsfan