Skip to content

Commit

Permalink
Update main.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
IsaacLiu2009 authored Jul 15, 2024
1 parent 00aa3d5 commit 173cc77
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion WinShutdown/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ int main(){
putchar('\n');
goto RESTART;
}
char cmd[1000010];
if (delta > 315360000){
puts("时间间隔过长,请输入不超过10年的时间。");
system("pause");
putchar('\n');
goto RESTART;
}
char cmd[60];
sprintf(cmd, "shutdown -s -t %lld", delta);
system("shutdown -a");
system(cmd);
puts("如若错误操作,使用shutdown -a命令取消关机。");
system("pause");
Expand Down

0 comments on commit 173cc77

Please sign in to comment.