1、C语言中system函数是执行DOS命令。
2、system函数包涵在stdlib.h头文件里。
3、Shutdown.exe的程序来完成关机操作(位置在Windows\System32下),一般情况下win8的关机是由关机程序 shutdown.exe来实现的,关机的时候调用shutdown.exe。
4、shutdown的用法:
shutdown -l 注销。这不能与 /m 或 /d 选项一起使用。
shutdown -s 关闭计算机。
shutdown -r 完全关闭并重新启动计算机。
shutdown -a 中止系统关闭。
shutdown -p 关闭本地计算机,没有超时或警告。
shutdown -h 休眠本地计算机。
shutdown -t xxx 将关闭前的超时时间设置为 xxx 秒。
shutdown -c "comment" 有关重新启动或关闭的原因的注释。
shutdown -f 强制关闭正在运行的应用程序而不事先警告用户。
shutdown -d [p|u:]xx:yy 提供重新启动或关闭的原因。
5、shutdown -s -t 15
这里时间是按秒来算的,即是15秒之后关机