Question Locked

shutdown command line through winsshd

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I'm testing winsshd on windows 2003 x64. I can stop and start services but when I run the shutdown command it errors: 'shutdown' is not recognized as an internal or external command,
operable program or batch file.

however, it will run from the server when run locally.

5 replies

by Former member

You can run locally on the server itself but not on another machine.

Please post back if you have any more problems or questions.

by the scummy one

written like
shutdown.exe instead of shutdown. Furthermore, on a server, you will need to add a reason for the shutdown, so it may require an option to be selected.

by rob miners

If it had the same name as the program you're trying to run in the batch, and you probably didn't specify the file extension when calling it.
So either renaming your original script to MyShutdown.bat or whatever.cmd will do the trick, or you can use shutdown.bat as name, but then you have to specify the shutdown command in the batch file either with the extension or with the path (and finally, if you're saving the batch as shutdown.bat in the same folder as shutdown.exe, you'll always need the extension):
shutdown.exe /r /f
or
%Systemroot%\system32\shutdown /r /f

This will work. ;)

by techrepublic

I realize this is an old post but figured someone else might benefit from my solution.
I was able to use shutdown via Remote command only after copying shutdown.exe from system32 to Syswow64. This is likely due to the remote command running under 32bit mode and so access to system32 is redirected to Syswow64.
I then was able to run shutdown from the syswow64 directory.

Just my 2 cents.

This discussion is closed to new replies.