TuMiM Posted January 30, 2006 Share Posted January 30, 2006 I am trying to write something that will search through a folder and subfolder for all files with a specific attribute. I know how to do it for one file in a specific path but how do you do it for multiple files and also search through sub directories? $input2 = GUICtrlRead($input1) $path1 = "\\server\storage\Core Folder" & "\" & $Input2 $attrib = FileGetAttrib($path1 & "\" & $input2 & ".avi") If StringInStr($attrib, "O") Then MsgBox(4096, "Offline", "Files in folder " & $input2 & " are offline", 10) Endif Endif Link to comment Share on other sites More sharing options...
ChrisL Posted January 30, 2006 Share Posted January 30, 2006 (edited) Is this any use? you'll need the beta version of AutoIT Search ("D:\Kiosk");replace with your search directory Func Search($current) Local $search = FileFindFirstFile($current & "\*.*") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file) < 1 Then ExitLoop If Not StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then If StringInStr(FileGetAttrib($current & "\" & $file), "R") then MsgBox (0,$current & "\" & $file, "Has Attribut r") EndIf If StringInStr(FileGetAttrib($current & "\" & $file), "D") And ($file <> "." Or $file <> "..") Then Search($current & "\" & $file) EndIf WEnd FileClose($search) EndFunc Edited January 30, 2006 by ChrisL [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
TuMiM Posted January 30, 2006 Author Share Posted January 30, 2006 That works, thanks. Is there any way to populate a list box or something like that with the results? Link to comment Share on other sites More sharing options...
ChrisL Posted January 30, 2006 Share Posted January 30, 2006 That works, thanks. Is there any way to populate a list box or something like that with the results?You need to creat a Gui with a listbox$mylist=GUICtrlCreateList ("", 176,32,121,97)Then you would need to use GUICtrlSetData($mylist,$Current & "|") [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
TuMiM Posted January 30, 2006 Author Share Posted January 30, 2006 once again thanks for all that help but just one more question. I got it to work with the listbox but for the life of me i can't get it to create a new gui and populate the list box. This command is running in a main gui but if it detects the attribute O in any of those files, I wanted it to open a new gui and populate the list box inside it. Everything i tried has failed other than creating a list box in the main gui. Link to comment Share on other sites More sharing options...
ChrisL Posted January 30, 2006 Share Posted January 30, 2006 I'm not sure I follow what your doing. Can you try and describe it better Post the code you have already, I'm logging off now so if I know how to do whatever your trying to do I'll post tomorrow, unless someone else does it before [u]Scripts[/u]Minimize gui to systray _ Fail safe source recoveryMsgbox UDF _ _procwatch() Stop your app from being closedLicensed/Trial software system _ Buffering Hotkeys_SQL.au3 ADODB.Connection _ Search 2d Arrays_SplashTextWithGraphicOn() _ Adjust Screen GammaTransparent Controls _ Eventlogs without the crap_GuiCtrlCreateFlash() _ Simple Interscript communication[u]Websites[/u]Curious Campers VW Hightops Lambert Plant Hire Link to comment Share on other sites More sharing options...
randallc Posted January 30, 2006 Share Posted January 30, 2006 Hi,You could look at brian's search engine which switches GUI to make Listview; and shows switching back again when the second closes;search_engine_1.5.1.5.3.au3Best, RandallGUISetState(@SW_HIDE, $mainGUI) $readdrivecombo = GUICtrlRead($drivecombo) $searchquierie = GUICtrlRead($searchquierieinput) $searchGUI = GUICreate("Searching... (Esc cancels)", 800, 600, (@DesktopWidth - 800) / 2, (@DesktopHeight - 600) / 2) $searchlistView = GUICtrlCreateListView("Filename|Location|Size|Date Modified|Date Created|File Extension", 10, 10, 790, 570) $statuslabel = GUICtrlCreateLabel("", 10, 580, 790, 20)etc.... ExcelCOM... AccessCom.. Word2... FileListToArrayNew...SearchMiner... Regexps...SQL...Explorer...Array2D.. _GUIListView...array problem...APITailRW Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now