Guest Timo Posted June 10, 2004 Share Posted June 10, 2004 Hello together, the following code shows me each file in a messagebox: ; Shows the filenames of all files in the current directory $search = FileFindFirstFile("*.*") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf While 1 $file = FileFindNextFile($search) If @error Then ExitLoop MsgBox(4096, "File:", $file) WEnd ; Close the search handle FileClose($search) How can I get all the files in one list? Has anyone an idea? Thanks, Timo Link to comment Share on other sites More sharing options...
bobheart Posted June 11, 2004 Share Posted June 11, 2004 Do it in a dos bat like this : dir/s/oe %1 /o:gn > "%temp%\Dir Listing" cd\ if not exist dirlist\NUL md dirlist if exist c:\dirlist\Dirlist.txt goto Two move "%temp%\Dir Listing" c:\dirlist\Dirlist.txt goto End :Two move "%temp%\Dir Listing" c:\dirlist\Dirlist2.txt :End cd dirlist call nextfile Dirlist txt cd\ c:\dirlist\%Highest% maybe that will help you . Link to comment Share on other sites More sharing options...
Holger Posted June 11, 2004 Share Posted June 11, 2004 @Timo: you could add all 'find files' to an array like this: $dirlist[1000]; ok..I know that ~1000 files in one directory is not really real;-) $search = FileFindFirstFile("*.*") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf $idx = 0; this variable you could use to set the highest array-entry While 1 $file = FileFindNextFile($search) If @error Then ExitLoop $idx = $idx + 1 $dirlist[0] = $idx; save the current (max) index to the first array-field $dirlist[$idx] = $file; save the $file in the current array-field which ist pointed by the current index MsgBox(4096, "File:", $file) WEnd ; Close the search handle FileClose($search) Old project:GUI/Tray menu with icons and colors Other old stuff:IconFileScanner, TriState/ThreeState GUI TreeView, GUI ContextMenu created out of a TreeView Link to comment Share on other sites More sharing options...
Guest Timo Posted June 11, 2004 Share Posted June 11, 2004 Hi, thanks a lot. I´m new to AutoIt and this is my first program. I think I take Larrys solution it is the most simple for me. By the way, please excuse my bad english but I come from Germany... I´m very surprised how fast your reaction was. It seems to be a very good board and nice people helping everyone, isn´t it? Now I go programming. Bye, Timo Link to comment Share on other sites More sharing options...
bobheart Posted June 11, 2004 Share Posted June 11, 2004 This prints out a list . Run(@ComSpec & " /k dir /s > myfile.txt ") 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