The flavour you use is different again from the three flavours I previously
quoted. Where does the command reside? Did you include the full drive+path
when invoking it?
Instead of just running shutdown, run this file:
@echo off
echo %date% %time% %UserName% >> c:\test.log
"c:\Some Folder\shutdown.exe /.. /.. 1>>c:\test.log 2>>&1
echo %date% %time% >> c:\test.log
What is the contents of c:\test.log when the command fails?
"Haggis" <Haggis@discussions.microsoft.com> wrote in message
news:78E8BBFE-E306-4655-9326-9EB0A6CC8771@microsoft.com...
> Usage: shutdown [/i | /l | /s | /r | /a | /p | /h | /e] [/f]
> [/m \\computer][/t xxx][/d [p:]xx:yy [/c "comment"]]
>
> "Pegasus (MVP)" wrote:
>
>> I don't know about Windows 2000 Server but Windows 2000 Professional did
>> not
>> have a native shutdown command. You had to download a third-party
>> version.
>> Where does your version reside? What is its syntax? What do you get when
>> you
>> type "shutdown /?" ?
>>
>>
>> "Haggis" <Haggis@discussions.microsoft.com> wrote in message
>> news:4E5BFA7C-0480-4372-BB43-12AC0A88CA21@microsoft.com...
>> > OK...i am getting slightly confused. Refering to different flavours and
>> > specifying drive and folder, does this mean that there are differnet
>> > shutdown
>> > files in a server installation? If so what are their different
>> > locations.
>> > If
>> > not, why use different flavour over another and do you recommend a
>> > specific
>> > one for what i am trying to do?
>> >
>> > "Pegasus (MVP)" wrote:
>> >
>> >> The syntax matters a great deal. Here it is for three different
>> >> flavours
>> >> of
>> >> shutdown.exe:
>> >>
>> >> Flavour 1
>> >> ======
>> >> Usage: SHUTDOWN [/?] [\\Computer] [/L] [/A] [/R] [/T:xx] ["Msg"] [/Y]
>> >> [/C]
>> >> /? Shows this screen.
>> >> \\Computer Specifies a remote computer to shutdown.
>> >> /L Specifies a local shutdown.
>> >> /A Abortes a systemshutdown. This is only possible during
>> >> the
>> >> timeout period.If this switch is used, all other are
>> >> ignored.
>> >> /R Specifies that the machine should reboot after
>> >> shutdown.
>> >> /T:xx Sets the timer for system shutdown in seconds.[20 sec.
>> >> default]
>> >> "Msg" Specifies an additional message
>> >> /Y Answer all following questinons with yes
>> >> /C Forces running applications to close.
>> >> ATTENTION: If you use the /C parameter NT ignores the
>> >> applications option to save data which may
>> >> have canged. You will see no File-Save
>> >> dialog
>> >> box, because NT will force the application
>> >> to
>> >> close. This will result in a loss of all
>> >> data.
>> >> not previously saved !!!
>> >>
>> >> Flavour 2
>> >> =======
>> >> Usage: shutdown [-lkurhs] [-f] [-c] [-t sec]
>> >> -l: Log Off.
>> >> -u: Shutdown (Turn Off).
>> >> -r: Restart.
>> >> -h: Hibernate.
>> >> -s: Stand By (Sleep).
>> >> -f: Force the action.
>> >> -c: Cancel a running shutdown.
>> >> -t sec: Delay for number of seconds.
>> >>
>> >> Flavour 3
>> >> ======
>> >> Usage: shutdown [-i | -l | -s | -r | -a] [-f] [-m \\computername] [-t
>> >> xx]
>> >> [-c "c
>> >> omment"] [-d up:xx:yy]
>> >>
>> >> No args Display this message (same as -?)
>> >> -i Display GUI interface, must be the
>> >> first
>> >> option
>> >> -l Log off (cannot be used with -m
>> >> option)
>> >> -s Shutdown the computer
>> >> -r Shutdown and restart the computer
>> >> -a Abort a system shutdown
>> >> -m \\computername Remote computer to
>> >> shutdown/restart/abort
>> >> -t xx Set timeout for shutdown to xx seconds
>> >> -c "comment" Shutdown comment (maximum of 127
>> >> characters)
>> >> -f Forces running applications to close
>> >> without
>> >> warning
>> >> -d [p]:xx:yy The reason code for the shutdown
>> >> u is the user code
>> >> p is a planned shutdown code
>> >> xx is the major reason code (positive
>> >> integer less than 256)
>> >> yy is the minor reason code (positive
>> >> integer less than 65536)
>> >>
>> >> Note that some flavours use slashes for the switches and others use
>> >> dashes.
>> >> I suspect that you have two flavours on your machine, and since you do
>> >> not
>> >> specify a drive or a folder name, you can never be sure which version
>> >> you
>> >> execute. Specifying drive + folder is compulsory if you want your
>> >> batch
>> >> files to be robust. For good measure you should add a file extension
>> >> too.
>> >>
>> >> You should also drop the "call" instruction. It serves no purpose
>> >> here,
>> >> unless you're calling a batch file called "shutdown.bat" (which I hope
>> >> you
>> >> don't!).
>> >>
>> >>
>> >> "Haggis" <Haggis@discussions.microsoft.com> wrote in message
>> >> news:3CBC0921-0959-441C-AF22-86A664126190@microsoft.com...
>> >> >I wouldn't have thought it would matter too much as the command semms
>> >> >to
>> >> >work
>> >> > but under slightly different conditions, anyway the syntax i am
>> >> > using
>> >> > is:
>> >> >
>> >> > call shutdown /s /f /m \\SERVERname
>> >> >
>> >> > "Pegasus (MVP)" wrote:
>> >> >
>> >> >>
>> >> >> "Haggis" <Haggis@discussions.microsoft.com> wrote in message
>> >> >> news:64905806-479B-4A43-BB8F-D851F902CAF0@microsoft.com...
>> >> >> >I have an odd issue. the scenario is this.
>> >> >> > i have a server (A) connected to a UPS that is set to run a batch
>> >> >> > file
>> >> >> > when
>> >> >> > the battery power gets to some predetermined level. THis batch
>> >> >> > file
>> >> >> > is
>> >> >> > a
>> >> >> > remote shutdown command to bring down the another server (B)
>> >> >> > connected
>> >> >> > to
>> >> >> > the
>> >> >> > UPS.
>> >> >> >
>> >> >> > As part of the test i send a command line email before and after
>> >> >> > the
>> >> >> > remote
>> >> >> > shutdown command so that i know that it has run. Now the remote
>> >> >> > shutdown
>> >> >> > command runs properly when i test it on the Server (A) and both
>> >> >> > emails
>> >> >> > are
>> >> >> > sent. When i test it on the UPS, the emails are sent but the
>> >> >> > remote
>> >> >> > shutdown
>> >> >> > command fails. I cannot understand why, it is obvious that the
>> >> >> > command
>> >> >> > is
>> >> >> > running but as the emails fire, but no remote shutdown.
>> >> >> >
>> >> >> > Any ideas? thanks in advance
>> >> >>
>> >> >> You need to report precisely how the whole concept hangs together.
>> >> >> Presumably you use a batch file to send the EMail message and
>> >> >> perform
>> >> >> the
>> >> >> shutdown. Let's have a look at the batch file and the shutdown
>> >> >> command!
>> >> >> Since there are numerous shutdown commands, you must report which
>> >> >> one
>> >> >> you
>> >> >> use.
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>