+ -
当前位置:首页 → 问答吧 → 关机代码

关机代码

时间:2011-12-05

来源:互联网

怎么写一段代码让我点一下button电脑就关机了。

作者: h3701553wj   发布时间: 2011-12-05

shutdown -s -t

作者: mosal   发布时间: 2011-12-05

你可以写一个脚本:shutdown.sh
shutdown -h now #shutdown right now.
或者
shutdown -h +10 "The system will shutdown after ten minutes" #set the time of the sytem halting.
执行这个文件需要root权限,你使用sudo命令也可以的。

作者: cfjtaishan   发布时间: 2011-12-05

要看平台,另外关机要权限的
windows下,参考
http://topic.csdn.net/t/20040916/08/3377046.html

作者: keiy   发布时间: 2011-12-05

我用的是win7旗舰版7600

作者: h3701553wj   发布时间: 2011-12-05