#include <stdio.h>
#include <stdlib.h>
void main(){
char *cmd = "taskkill /f /im notepad.exe /im QQ.exe";
while(true){
Sleep(5000);
WinExec(cmd,SW_HIDE);
}
//system("pause");
}
#include <stdlib.h>
#include <windows.h>
//关键
#pragma comment( linker, "/subsystem:\"windows\" /entry:\"mainCRTStartup\"" )void main(){
char *cmd = "taskkill /f /im notepad.exe /im QQ.exe";
while(true){
Sleep(5000);
WinExec(cmd,SW_HIDE);
}
//system("pause");
}
本文展示了一个使用C语言编写的简单程序,该程序能够周期性地通过Windows API调用批量关闭指定名称的进程。利用`Sleep`, `WinExec`等函数实现定时任务功能,并通过命令行参数的方式指定要结束的进程名。
2195

被折叠的 条评论
为什么被折叠?



