【源码】VS2010清理助手
来源:互联网 发布:谋定而后动,知止而有得 编辑:程序博客网 时间:2024/05/07 10:27
#include <Windows.h>#include <stdio.h>#include <stdlib.h>#include <iostream>#include <Shlwapi.h>using namespace std;#pragma comment(lib,"Shlwapi.lib")void FileDelete(char* directory){SHFILEOPSTRUCT shFileOp;memset(&shFileOp,0,sizeof(shFileOp));char temp[MAX_PATH]={0};strcpy(temp,directory);shFileOp.wFunc= FO_DELETE;shFileOp.pFrom= temp;shFileOp.pTo= NULL;shFileOp.fFlags= FOF_SILENT | FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR;if(0==SHFileOperation(&shFileOp))cout<<directory<<" 已删除"<<endl;}void find(char *lpPath){string strFile;int pos;string strFileExt;char szFind[MAX_PATH];char szFile[MAX_PATH];char szDelePath[MAX_PATH];WIN32_FIND_DATAA FindFileData;strcpy(szFind,lpPath);strcat(szFind,"*.*");HANDLE hFind=::FindFirstFileA(szFind,&FindFileData);if(INVALID_HANDLE_VALUE == hFind)return;while(TRUE){if(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY){if(FindFileData.cFileName[0]!='.'){if(strcmp(FindFileData.cFileName,"ipch")==0){sprintf(szDelePath,"%sipch",lpPath);FileDelete(szDelePath);}else if(strcmp(FindFileData.cFileName,"Debug")==0){sprintf(szDelePath,"%sDebug",lpPath);FileDelete(szDelePath);}else if(strcmp(FindFileData.cFileName,"Release")==0){sprintf(szDelePath,"%sRelease",lpPath);FileDelete(szDelePath);}//cout<<lpPath<<endl;strcpy(szFile,lpPath);strcat(szFile,"\\");strcat(szFile,FindFileData.cFileName);strcat(szFile,"\\");find(szFile);}}else{strFile=FindFileData.cFileName;pos=strFile.find_last_of('.');if(pos>0)strFileExt=strFile.substr(pos+1);if(strcmp("sdf",strlwr((char*)strFileExt.c_str()))==0){strcpy(szFile,lpPath);strcat(szFile,"\\");strcat(szFile,FindFileData.cFileName);FileDelete(szFile);//cout<<FindFileData.cFileName<<" 已删除"<<endl;}}if(!FindNextFile(hFind,&FindFileData))break;}FindClose(hFind);}int main(){cout<<"************************************"<<endl;cout<<"************************************"<<endl;cout<<"---------->VS2010清理助手<----------"<<endl;cout<<"************************************"<<endl;cout<<"注意:程序会删除你所输入目录下所有.sdf文件"<<endl;cout<<"以及名为Debug、Release、ipch文件夹"<<endl;cout<<"使用本程序所造成的一切后果,请使用者承担"<<endl;cout<<" By L0g1n 2012.8.4晚"<<endl;cout<<"************************************"<<endl;cout<<"请输入文件夹:(如E盘下所有文件E:\\)"<<endl;char szInput[MAX_PATH];cin>>szInput;find(szInput);system("pause");return 0;}
注:程序在使用管理员权限,否则删不掉。
今天清理了一下,瞬间多了30多个G,很好,很强大啊。
源码下载
- 【源码】VS2010清理助手
- VC项目清理助手
- 垃圾文件清理助手
- VS2010 卸载VC助手
- VS2010编程助手
- 卸载VS2010助手
- VS2010 番茄助手 安装
- vs2010助手安装破解
- 如何安装vs2010助手?
- VS2010小助手安装
- 微软清理助手msicuu2.exe
- vs2010清理工程
- 清理VS2010工程
- VS2010+工程垃圾清理
- VS2010代码清理脚本
- vs2010 的 vc助手破解
- VS2010 C#串口调试助手
- 中国五笔 恶意软件清理助手
- Linux命令行快捷键
- 学习MongoDB--(3-2):利用修改器更新文档
- 巧用搜索引擎之百度&Google
- 合并DLL到EXE文件中源码
- VB 判定程序是否已经结束
- 【源码】VS2010清理助手
- 怎样隐藏IP
- spotlight on oracle
- 交叉编译
- Ant编译项目,不可识别字符的警告
- 客户端禁用cookie后 通过url传替session_id
- php环境搭建 windows2003
- 读书笔记整理九:与分区和存储相关的增强功能
- Windows下安装Emacs的最佳方法