Search code examples
batch-fileremote-accessshutdown

Is it possible to shutdown someone else's computer from your computer in Batch?


So I've been pondering on this for about a week, is it possible to use a Batch file to shut someone else's computer off? I already know that shutdown.exe /s or shutdown.exe /s /t 00 shuts down your own computer, and that by replacing /s with /l or /r will logoff or restart your computer, but what I want to know is that is it possible to remotely shut someone else's computer off with similar commands. Obviously the code will be really complex if it is possible


Solution

  • Yes, provided you have sufficient rights on the remote computer to do so. See the documentation for shutdown, particularly the /m switch.

    shutdown /m \\computertoshutdown
    

    For information about the required rights, see the Remarks page in the linked documentation.