infernothebest Posted December 22, 2005 Share Posted December 22, 2005 i wanna make a autoit file thats search on extention and write it in a text file, but i must see the full path and date i got this so far$search = FileFindFirstFile("*.prt") If $search = -1 Then FileWriteLine("1.txt", $search) MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop FileWriteLine("1.txt", $file) WEnd FileClose($search) Apple Keybord shortcuts for XP Link to comment Share on other sites More sharing options...
Valuater Posted December 22, 2005 Share Posted December 22, 2005 i use filelisttoarraybut you might want to look at thishttp://www.autoitscript.com/forum/index.ph...st=0&p=1336368) Link to comment Share on other sites More sharing options...
Valuater Posted December 22, 2005 Share Posted December 22, 2005 heres an example of FileListToArray()http://www.autoitscript.com/forum/index.php?showtopic=19255#8) Link to comment Share on other sites More sharing options...
infernothebest Posted December 22, 2005 Author Share Posted December 22, 2005 i think this would help but it doesnt work 100% i need some changes and your help $tosearch = "C:" $output = FileOpen("c:\filelist.txt",1) $start = TimerInit() RecFileSearch($tosearch) FileClose($output) MsgBox(0,"done","it only took " & int(TimerDiff($start)/1000) & " seconds") Func RecFileSearch($current) Local $search = FileFindFirstFile($current & "\*.prt") While 1 Dim $file = FileFindNextFile($search) If @error Or StringLen($file)<1 Then ExitLoop FileWriteLine($output,$current & "\" & $file & " " & FileGetSize($file)) If StringInStr(FileGetAttrib($current & "\" & $file),"D") And ( $file <> "." Or $file <> ".." ) Then RecFileSearch($current & "\" & $file) WEnd FileClose($search) EndFunc it must give me the date from the file and it must look in all folders and subfolders and look for the extention .prt, then it must write a file with all the data Apple Keybord shortcuts for XP Link to comment Share on other sites More sharing options...
MHz Posted December 22, 2005 Share Posted December 22, 2005 Maybe this may suit your needs. The Dir command may seach C: faster then FFFF\FFNF. RunWait(@ComSpec & ' /c Dir C:\*.prt /s/b > "' & @ScriptDir & '\temp.txt"', '', @SW_HIDE) $handle_read = FileOpen(@ScriptDir & '\temp.txt', 0) $handle_write = FileOpen(@ScriptDir & '\prt.txt', 2) While 1 $line = FileReadLine($handle_read) If @error Then ExitLoop $file = StringStripWS($line, 3) If Not $file Then ContinueLoop If FileExists($file) Then FileWriteLine($handle_write, FileGetTime($file, 0, 1) & @TAB & FileGetSize($file) & @TAB & $file) EndIf WEnd FileClose($handle_read) FileClose($handle_write) FileDelete(@ScriptDir & '\temp.txt') It may give you are different view to create your list. 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