当前位置:网站首页>C language to realize computer automatic shutdown program -- it can be used to spoof roommate's computer
C language to realize computer automatic shutdown program -- it can be used to spoof roommate's computer
2022-06-09 20:28:00 【Beans from Java】
The realization of computer shutdown mainly uses shutdown command
shutdown command
shutdown -a Cancel shutdown
shutdown -s To turn it off
shutdown -f Forcibly close the application
shutdown -m \\ Computer name Control remote computer
shutdown -i Show “ Remote shutdown ” Graphical user interface , But it has to be Shutdown The first parameter of
shutdown -l Logout the current user
shutdown -r Shut down and restart
shutdown -s -t Time Set shutdown countdown
shutdown -r -t Time Set restart countdown
shutdown -h Sleep
This procedure mainly uses shutdown -s -t Time and shutdown -a To achieve
// Use a loop to achieve
int main()
{
char arr[20]; // It is used to store the symbols entered when canceling the shutdown
system("shutdown -s -t 60"); // To turn it off , Set up 60s Power off after
while (1)
{
printf(" The computer 60 Shut down in seconds , To cancel , Please enter sos\n");
scanf("%s", arr);
if (0 == strcmp(arr, "sos"))
{
system("shutdown -a"); // If the input symbol is sos, Then cancel the shutdown
break;
}
}
}Running results

Input sos, Cancel shutdown


A spoof :
PC local search “ service ”, take .exe Add files to , Change to auto start , So every time the computer is turned on , That is, the operating system starts , It will automatically shut down within the set time , Unless you enter a symbol set in advance
reminder : Proper Entertainment , Proper Entertainment , Don't play too much !!!

边栏推荐
猜你喜欢

2022 Shandong Health Expo, dietotherapy and nourishing health exhibition, health management and precision medicine Exhibition

The HMI Software memory is abnormal, resulting in a crash exit bug

HMI 联机下载失败的问题及解决方案

Apply for software code signing certificate

【mysql】主从复制原理、搭建

2022山东健博会,食疗养生与滋补健康展,健康管理与精准医学展

Apple Announces Winner of the 2022 Apple Design Award

Safety net interview (Miscellaneous)

JVM-字节码是如何被JVM执行的+关于线程一点思想引子

Neo4j desktop database backup
随机推荐
Apple Announces Winner of the 2022 Apple Design Award
asp. Net TXT read / write
Blog recommended | bookkeeper - Apache pulsar high availability / strong consistency / low latency storage implementation
Redis knowledge points
学习使用php实现无限极评论和无限极转二级评论解决方案
LeetCode 497. 非重叠矩形中的随机点**
Two employees of Shanghai Institute of Optics and mechanics are nucleic acid positive, and 367 people in the park will be transferred
Problems and solutions of HMI online download failure
安路科技发布SF1系列FPSoC新品:高集成低功耗,助力实现多种应用场景
FPGA introduction experiment - multi key control of variable speed running light and jump light based on state machine
Leetcode 1984. 學生分數的最小差值(可以,已解决)
Official announcement! Broadcom will acquire VMware with us $61billion and assume US $8billion in debt
Detailed explanation of uboot
这6种实现负载均衡技术的方式不容错过
Drink at night, 50 classic SQL questions, really fragrant~
Logback log profile add color discrimination
Download the latest global epidemic history data to the two days before the current day
Safety net interview (Miscellaneous)
Jerry's application of camera [chapter]
Odoo passed ir model. access. CSV modify other module permissions