*/ --------------------------------------------------------------------------------------
*/ 出自: 编程中国 http://www.bc-cn.net
*/ 作者: cycchina E-mail:china.cyc@gmail.com QQ:6080522
*/ 时间: 2007-8-25 编程论坛首发
*/ 声明: 尊重作者劳动,转载请保留本段文字
*/ --------------------------------------------------------------------------------------
代码在Dev-C++ 上编译通过
如果不想每次都清理,可以手动删除 注册表启动Run下Wincleaner.bat
#include <stdio.h>
#include <process.h>
main()
{
FILE *fout;
char bat[10]={"@ECHO OFF"};
char bat1[5]={"CLS"};
char bat2[15]={"title 中CYC国"};
char bat3[39]={"ECHO 版权所有 2006-2008 Chinese CYC"};
char bat4[39]={"ECHO Email:China.cyc@Gmail.com "};
char bat5[8]={"color 2"};
char bat6[58]={"ECHO CYC系统维护工程师 正在清除系统垃圾文件,请稍候......"};
char bat7[50]={"del /f /s /q %systemdrive%\\*.tmp"};
char bat8[50]={"del /f /s /q %systemdrive%\\*._mp"};
char bat9[50]={"del /f /s /q %systemdrive%\\*.gid"};
char bat10[50]={"del /f /s /q %systemdrive%\\*.chk"};
char bat11[50]={"del /f /s /q %systemdrive%\\*.old"};
char bat12[50]={"del /f /s /q %systemdrive%\\recycled\\*.*"};
char bat13[40]={"del /f /s /q %windir%\\*.bak"};
char bat14[50]={"del /f /s /q %windir%\\prefetch\\*.*"};
char bat15[50]={"rd /s /q %windir%\\temp & md %windir%\\temp"};
char bat16[50]={"del /f /q %userprofile%\\cookies\\*.*"};
char bat17[50]={"del /f /s /q %userprofile%\recent\\*.*"};
char bat18[40]={"del %SystemRoot%\\Prefetch\\*.* /q"};
char bat19[75]={"del /f /s /q \"%userprofile%\\Local Settings\\Temporary Internet Files\\*.*\""};
char bat20[58]={"del /f /s /q \"%userprofile%\\Local Settings\\Temp\\*.*\""};
char bat21[44]={"del /f /s /q \"%userprofile%\\recent\\*.*\""};
char bat22[50]={"ECHO 清除工作完成!"};
char bat23[50]={"ECHO 如有疑问 QQ:6080522"};
char bat24[14]={"ECHO. & pause"};
FILE *output=NULL;
char *regadd={"REGEDIT4\n\n[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run]\n\"Wincleaner.bat\"=\"C:\\\\Windows\\\\system32\\\\Wincleaner.bat /s\""};
if((output=fopen("$$$$$","w"))!=NULL)
{
fprintf(output,regadd);
fclose(output);
_spawnl(1,"c:\\windows\\regedit.exe"," /s $$$$$",NULL);
}
fout=fopen("c:\\Windows\\system32\\Wincleaner.bat","w");
{ fprintf(fout, "%s\n",bat);
fprintf(fout, "%s\n", bat1);
fprintf(fout, "%s\n", bat2);
fprintf(fout, "%s\n", bat3);
fprintf(fout, "%s\n", bat4);
fprintf(fout, "%s\n", bat5);
fprintf(fout, "%s\n", bat6);
fprintf(fout, "%s\n", bat7);
fprintf(fout, "%s\n", bat8);
fprintf(fout, "%s\n", bat9);
fprintf(fout, "%s\n", bat10);
fprintf(fout, "%s\n", bat11);
fprintf(fout, "%s\n", bat12);
fprintf(fout, "%s\n", bat13);
fprintf(fout, "%s\n", bat14);
fprintf(fout, "%s\n", bat15);
fprintf(fout, "%s\n", bat16);
fprintf(fout, "%s\n", bat17);
fprintf(fout, "%s\n", bat18);
fprintf(fout, "%s\n", bat19);
fprintf(fout, "%s\n", bat20);
fprintf(fout, "%s\n", bat21);
fprintf(fout, "%s\n", bat22);
fprintf(fout, "%s\n", bat23);
fprintf(fout, "%s\n", bat24);
}
fclose(fout);
}