设置电脑关机

一、定时关机:

str.Format("shutdown -s -t %d",3600*n);  

system(str);//设置关机时间

  注意:system("shutdown -s -t 3600");代表一小时后关机

二、取消关机:

system("shutdown -a");//取消关机

原文地址:https://www.cnblogs.com/judes/p/5910610.html