Stuperman Posted February 1, 2008 Posted February 1, 2008 #include <file.au3> ; Shows the filenames of all files in the current directory $search = FileFindFirstFile("*.mp3") ; 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 _FileWriteLog(@ScriptDir & "\songlist.log",$file) WEnd ; Close the search handle FileClose($search) This is the code I have so far. I just need to figure out how to search in all subdirectories as well. Any help again would be awesome.
Kerros Posted February 1, 2008 Posted February 1, 2008 Do a search on the forum for "Recursive file search" and you should come up with some options. Kerros===============================================================How to learn scripting: Figure out enough to be dangerous, then ask for assistance.
weaponx Posted February 1, 2008 Posted February 1, 2008 See #1 for an example:http://www.autoitscript.com/forum/index.ph...filelisttoarray
Stuperman Posted February 1, 2008 Author Posted February 1, 2008 Forgive me, I am a little new and learning at a slow pace. Could someone possibly show me how I would incorporate that to just create a list of songs in all folders and subfolders. Thanks
weaponx Posted February 1, 2008 Posted February 1, 2008 Forgive me, I am a little new and learning at a slow pace. Could someone possibly show me how I would incorporate that to just create a list of songs in all folders and subfolders. Thanks#include <array.au3>;Search for mp3 files recursively$Array = RecursiveFileSearch(@DesktopDir & "\New Folder", "(?i)\.(mp3)", true)_ArrayDisplay($Array)
covaks Posted February 1, 2008 Posted February 1, 2008 Another easier way, if dumping all mp3s to a log file is all you want to do: Run(@ComSpec & " /c dir /s /b *.mp3 >> songlist.log","C:\",@SW_HIDE)
Stuperman Posted February 1, 2008 Author Posted February 1, 2008 Thank you very much covaks. That worked perfectly. If anything, is there also a way to get that to tell me the number of songs in said directories as well?
covaks Posted February 1, 2008 Posted February 1, 2008 If you want the total number of songs, try this. It will append the count to the end of the file. (You can append the count to the top of the file too if you play around a bit. ) #include <File.au3> RunWait(@ComSpec & " /c dir /s /b *.mp3 >> songlist.log","C:\",@SW_HIDE) $File = FileOpen("C:\songlist.log",1) FileWriteLine($File, "Total number of songs: " & _FileCountLines("C:\songlist.log")) FileClose($File)
Stuperman Posted February 5, 2008 Author Posted February 5, 2008 I also am curious, how can I make this work if I store songs on the F drive for instance?
weaponx Posted February 5, 2008 Posted February 5, 2008 (edited) I also am curious, how can I make this work if I store songs on the F drive for instance?Anywhere you see C:, change to F: Edited February 5, 2008 by weaponx
RAMMRODD Posted February 6, 2008 Posted February 6, 2008 Could Something like this be used to get a list of songs off of my server?? I want to make a flash player that uses URL's from my server but I have like 100+ songs and dont want to click on everyone and copy their names and then past into the players code. Can this be used on a server?
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