IE临时文件夹和cookies里面的文件为什么删不掉?附代码
昨天下午弄的,清理系统垃圾的东东别的文件夹都能清,但IE临时文件夹和cookies这二个文件夹清不掉
试了直接用批处理删除指定文件都不行,提示找不到文件-_-!
d.rar
(1.67 KB)
刚才花了半个多小时看了一段视频-_-!就是CCTV采访杨永信电击治网瘾那个。。。还好我妈早生了我几年,要不然如我这般一天除了吃饭睡觉其它时间全泡在网上。。。估计让电死好几次了-_-!
;------------------------------------
.586
.model flat,stdcall
option casemap:none
include windows.inc
include user32.inc
include kernel32.inc
includelib user32.lib
includelib kernel32.lib
include comctl32.inc
includelib comctl32.lib
include advapi32.inc
includelib advapi32.lib
include shlwapi.inc
includelib shlwapi.lib
_DelFile proto :dword,:dword
_DelFile1 proto :dword,:dword,:dword
_RegQueryKey proto :dword,:dword,:dword
.const
ICO_MAIN equ 1000
.data
szFile db '*.*',0
szFile1 db '.tmp',0
szFile2 db '._mp',0
szFile3 db '.log',0
szFile4 db '.gid',0
szFile5 db '.chk',0
szFile6 db '.old',0
szFile7 db '.bak',0
sfolder db 'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders',0
sCache db 'Cache',0
path db '%s\',0
lSting db 'Local Settings',0
Recent db 'Recent',0
Cache db 'Cache',0
temp db 'temp',0
fetch db 'prefetch',0
.data?
Buffer db 256 dup (?)
Buffer1 db 128 dup (?)
.code
;------------------------------------
_DelFile Proc _lpszPath,_lpszFile
local stFindFile:WIN32_FIND_DATA
local hFindFile
local _Path[MAX_PATH]:byte
local _Search[MAX_PATH]:byte
local _FindFile[MAX_PATH]:byte
pushad
invoke lstrcpy,addr _Path,_lpszPath
invoke lstrlen,addr _Path
lea esi,_Path
add esi,eax
xor eax,eax
mov al,'\'
.if byte ptr [esi-1] != al
mov word ptr [esi],ax
.endif
invoke lstrcpy,addr _Search,addr _Path
invoke lstrcat,addr _Search,_lpszFile
invoke FindFirstFile,addr _Search,addr stFindFile
.if eax != INVALID_HANDLE_VALUE
mov hFindFile,eax
.repeat
invoke lstrcpy,addr _FindFile,addr _Path
invoke lstrcat,addr _FindFile,addr stFindFile.cFileName
.if stFindFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
.if stFindFile.cFileName != '.'
invoke _DelFile,addr _FindFile,_lpszFile
.endif
lea eax,_FindFile
invoke RemoveDirectory,eax
.endif
lea eax,_FindFile
invoke DeleteFile,eax
invoke FindNextFile,hFindFile,addr stFindFile
.until (eax == FALSE)
invoke FindClose,hFindFile
.endif
popad
ret
_DelFile endp
;------------------------------------
_DelFile1 Proc _lpszPath,_lpszFile,_lpName
local stFindFile:WIN32_FIND_DATA
local hFindFile
local _Path[MAX_PATH]:byte
local _Search[MAX_PATH]:byte
local _FindFile[MAX_PATH]:byte
pushad
invoke lstrcpy,addr _Path,_lpszPath
invoke lstrlen,addr _Path
lea esi,_Path
add esi,eax
xor eax,eax
mov al,'\'
.if byte ptr [esi-1] != al
mov word ptr [esi],ax
.endif
invoke lstrcpy,addr _Search,addr _Path
invoke lstrcat,addr _Search,_lpszFile
invoke FindFirstFile,addr _Search,addr stFindFile
.if eax != INVALID_HANDLE_VALUE
mov hFindFile,eax
.repeat
invoke lstrcpy,addr _FindFile,addr _Path
invoke lstrcat,addr _FindFile,addr stFindFile.cFileName
.if stFindFile.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY
.if stFindFile.cFileName != '.'
invoke _DelFile1,addr _FindFile,_lpszFile,_lpName
.endif
.endif
invoke StrStrI,addr _FindFile,_lpName
.if eax
lea eax,_FindFile
invoke DeleteFile,eax
.endif
invoke FindNextFile,hFindFile,addr stFindFile
.until (eax == FALSE)
invoke FindClose,hFindFile
.endif
popad
ret
_DelFile1 endp
;------------------------------------
_RegQueryKey proc _lpRoot,_lpSubKey,_lpValue
local szBuffer[256]:byte
local hKey,dwSize
invoke RegOpenKeyEx,_lpRoot,_lpSubKey,0,KEY_QUERY_VALUE,addr hKey
.if eax == ERROR_SUCCESS
invoke RegQueryValueEx,hKey,_lpValue,0,NULL,addr szBuffer,addr dwSize
invoke RegCloseKey,hKey
.endif
lea eax,szBuffer
ret
_RegQueryKey endp
;------------------------------------
start:
invoke _RegQueryKey,HKEY_CURRENT_USER,addr sfolder,addr lSting
invoke wsprintf,addr Buffer,addr path,eax
invoke lstrcat,addr Buffer,addr temp
invoke _DelFile,addr Buffer,addr szFile
;C:\Documents and Settings\BlackGirl\Local Settings\temp
invoke _RegQueryKey,HKEY_CURRENT_USER,addr sfolder,addr Recent
invoke wsprintf,addr Buffer,addr path,eax
invoke _DelFile,addr Buffer,addr szFile
;C:\Documents and Settings\BlackGirl\Recent
;******
;invoke _RegQueryKey,HKEY_CURRENT_USER,addr sfolder,addr Cache
;invoke wsprintf,addr Buffer,addr path,eax
;invoke _DelFile,addr Buffer,addr szFile
;ie temp
;******
invoke GetSystemWindowsDirectory,addr Buffer1,sizeof Buffer1
invoke wsprintf,addr Buffer,addr path,addr Buffer1
invoke lstrcat,addr Buffer,addr temp
invoke _DelFile,addr Buffer,addr szFile
;C:\Windows\temp
invoke wsprintf,addr Buffer,addr path,addr Buffer1
invoke lstrcat,addr Buffer,addr fetch
invoke _DelFile,addr Buffer,addr szFile
;C:\Windows\prefetch
invoke _DelFile1,addr Buffer1,addr szFile,addr szFile1
invoke _DelFile1,addr Buffer1,addr szFile,addr szFile2
invoke _DelFile1,addr Buffer1,addr szFile,addr szFile3
invoke _DelFile1,addr Buffer1,addr szFile,addr szFile4
invoke _DelFile1,addr Buffer1,addr szFile,addr szFile5
invoke _DelFile1,addr Buffer1,addr szFile,addr szFile6
invoke _DelFile1,addr Buffer1,addr szFile,addr szFile7
invoke ExitProcess,NULL
end start