I need this code to look under one folder deep for exe files not just in the top folder but one or 2 folders under only no more then 2 folders tho..
Anyone know how i can set that up?
Code and app below..
Thanks for any help that you guys can give..
Code:LB = "ListBox1"; --Disable listbox Updating ListBox.SetUpdate(LB, false); --Set default folder folder = Dialog.FolderBrowse("Open Folder", _DesktopFolder); --Set Default Extension if folder ~= "CANCEL" then ListBox.SetEnabled(LB, true); ListBox.DeleteItem(LB, -1); -- tbSearchFiles = {"*.doc", "*.ppt", "*.odt", "*.exe"}; set your own file types here -- this one search all types tbSearchFiles = {"*.exe", }; for index,type in tbSearchFiles do file = File.Find(folder, type, true, false, nil); if file ~= nil and file ~="CANCEL" then --do the following for each file: for j,file_path in file do --add the item to the listbox, with the name visible and path as data tbFilePath = String.SplitPath(file_path); sFile = tbFilePath.Filename..tbFilePath.Extension; ListBox.AddItem(LB, sFile, file_path); end end end end --Allow the listbox to display the updated content ListBox.SetUpdate(LB, true);

Reply With Quote