alvli2
alvli2

Reputation: 1

Quickly shut down a remote server with batch file

I know how to use a shut down command (shutdown -r -f -f 0) to shut down a computer but I am trying to create a batch file to shut down remotely a computer/server in case of emergency.

Thanks. Amir

Upvotes: 0

Views: 701

Answers (1)

Paweł Piwowar
Paweł Piwowar

Reputation: 174

shutdown with "/m" parameter shutdown.exe /m \\hostname -s -t 0

or wmic.exe OS Where Primary=TRUE Call Win32Shutdown 1

or psshutdown.exe from Sysinternals

or psexec.exe \\hostname -u [user] -p [password] -accepteula shutdown.exe -s -t 0

https://technet.microsoft.com/en-us/sysinternals/pxexec.aspx

https://technet.microsoft.com/en-us/sysinternals/psshutdown.aspx

Upvotes: 2

Related Questions