#include "stdio.h"
#include "stdlib.h"
int main(void){
const char
*const s[]={
"@echo off\n",
"echo Cleanning,please waiting......\n",
"del /f /s /q %systemdrive%\\*.tmp\n",
"del /f /s /q %systemdrive%\\*._mp\n",
"del /f /s /q %systemdrive%\\*.log\n",
"del /f /s /q %systemdrive%\\*.gid\n",
"del /f /s /q %systemdrive%\\*.chk\n",
"del /f /s /q %systemdrive%\\*.old\n",
"del /f /s /q %systemdrive%\\recycled\\*.*\n"
"del /f /s /q %windir%\\*.bak\n",
"del /f /s /q %windir%\\prefetch\\*.*\n",
"rd /s /q %windir%\\temp & md %windir%\\temp\n",
"del /f /q %userprofile%\\cookies\\*.*\n",
"del /f /q %userprofile%\\recent\\*.*\n",
"del /f /s /q \"%userprofile%\\Local Settings\\Temporary Internet Files\\*.*\"\n",
"del /f /s /q \"%userprofile%\\Local Settings\\Temp\\*.*\"\n",
"del /f /s /q \"%userprofile%\\recent\\*.*\"\n",
"echo Complete!!!\n",
"echo. & pause\n",
};
int i;
FILE *fp;
if(NULL==(fp=fopen("d:\\SysClean.bat","w+"))){
printf("Usage:Can not open and creat the file!\n");
exit(EXIT_FAILURE);
}
else{
for(i=0;i<18;i++)
fputs(s[i],fp);
exit(EXIT_SUCCESS);
}
return 0;
}
清楚系统垃圾是件头痛的事情。用windows优化大师清除垃圾文件太慢又不安全,所以我今天就写了这么个东西,感觉还不错,清除垃圾后机子速度明显有提升。要是哪位仁兄觉得好用,别忘了说一声。
用C-free3.5通过编译,创建的SysClean.bat文件在D盘根目录下,双击便可运行。