Search code examples
windowslinuxshutdown

Shutdown Windows machine from linux terminal


I am running an application on linux machine. By giving the ip address of a windows machine as input, the application must shutdown the windows machine. If the machines run the same OS it is very easy but I'm confused how to do it in cross OS.


Solution

  • Command to shutdown windows system from linux -:

    $ net rpc -S <ip address> -U <username>%<password> shutdown -t 1 -f

    This command can be issued from bash or even set in cron job to shutdown the computer at a specific time and this command is shipped with many distros by default.