I would like to add some more folders to search for but not sure how or where to add them ?
Or maybe read from a txt file with the list of folders I want to search for ?
Or maybe read from a txt file with the list of folders I want to search for ?
Code:
-- Set the callback function (used by action Folder.Find) function FindCallBack(CurrentFolder) -- Show the cancel button StatusDlg.ShowCancelButton(true, "Cancel"); -- Set the status dialog title, message, and status text StatusDlg.SetTitle("Searching . . . "); StatusDlg.SetMessage("Please wait. Search is in progress."); StatusDlg.SetStatusText("Current Folder: " .. CurrentFolder); -- Check if the user pressed cancel cancel = StatusDlg.IsCancelled(); if cancel then -- Cancel was pressed, stop the current operation return false; else -- Cancel was not pressed, continue return true; end end -- Set the drive to search drive = "c:\\"; -- Set the folder to search for folder = "1 Click Spy Clean"; -- Search the specified drive for folders named "windows" -- Display the status dialog StatusDlg.Show(0, false); search_results = Folder.Find(drive, folder, true, FindCallBack); --Check to see if an error occurred during the search. If it did, display the error message. error = Application.GetLastError(); StatusDlg.Hide(); if error ~= 0 then Dialog.Message("Error",_tblErrorMessages[error]); else -- If no directories were found, inform the user if (search_results == nil) then Dialog.Message("Notice", "There are no folders named '" .. folder .. "' on drive '" .. drive .. "'."); -- If folders were found, display a dialog containing a list of their locations. else message = "A folder named '" .. folder .. "' was found at the following location(s):\r\n\r\n"; for index, path in search_results do message = String.Concat(message, path.."\r\n"); end Dialog.Message("File Search Results", message, MB_OK, MB_ICONINFORMATION, MB_DEFBUTTON1); end end
Comment