Shutdown Windows with Java

后端 未结 4 1278
清歌不尽
清歌不尽 2020-12-16 19:02

Is it possible to shutdown Windows programmatically with Java?

Cheers

4条回答
  •  独厮守ぢ
    2020-12-16 19:51

    Run the command "shutdown -s".

    Edit: Something like this:

    Process p = Runtime.getRuntime().exec("shutdown -s");
    

提交回复
热议问题