Re: Convert file names to a usable list?
- From: "mayayana" <mayaXXyana1a@xxxxxxxxxxxxxxxx>
- Date: Thu, 3 Jan 2008 18:40:25 -0500
I'm not clear about how you're going to
use your list, but you can do anything like
that easily with script. It's a little more
work than command line but also less tedious
and primitive.
The following will create a list in any folder.
Just paste the text in Notepad, save as lister.vbs,
and drop a folder onto it. It will write a list of all
MP3 files to a file named list.txt inside the folder.
The list will write the full file paths.
You could also make it recursive, select different
file extensions, etc., if you want to delve into editing
the script.
---------------- script starts below here ---------
Dim FSO, Arg, oFol, oFils, oFil, TS, sList
On Error Resume Next
Arg = WScript.Arguments(0)
Set FSO = CreateObject("Scripting.FileSystemObject")
If FSO.FolderExists(Arg) = False Then
Set FSO = Nothing
WScript.Quit
End If
Set oFol = FSO.GetFolder(Arg)
Set oFils = oFol.Files
For Each oFil in oFils
If UCase(Right(oFil.Name, 3)) = "MP3" Then
sList = sList & oFil.Path & vbCrLf
End If
Next
Set oFils = Nothing
Set oFol = Nothing
Set TS = FSO.CreateTextFile(Arg & "\list.txt", True)
TS.Write sList
TS.Close
Set TS = Nothing
Set FSO = Nothing
MsgBox "List written as " & Arg & "\list.txt"
---------- script ends above here -----------------
fromIs it possible under Windows XP / Vista to create a database or list
andthe
names of files from within a directory and subdirectorys?
I want to make a list/database of quite a lot of mp3s so i can order
commandprint them in either access or excel.
The file structure I use is:
C:\...\Music\artist\artist - title.mp3
Many thanks
Gary
Open up a cmd prompt window.
use the cd command to get to the directory of interest.
You didn't give the full path so I can't spell it out for you.
To go from the Music directory to the artist directory
the command would be
cd artist
You can go one directory at a time or do it all with one
command. If the directory name has any spaces in it
you must enclose the string in double quotes.
i.e.
cd "Documents and Settings"
Once you get to the directory of interest the command
dir > list.txt
will create the list that you want.
Also try
dir /w > list.txt
to see if you prefer that format.
Thank you, its close to what i need but it doesnt include the subdirectory
of the artist that contains the actual mp3 file - ie. it only lists the
artists.
A typical full path is:
c:\documents and settings\gary\my documents\my music\aerosmith\aerosmith -
love in an elevator.mp3
So you see if I am in the "my music" directory the 'dir > list.txt'
only lists the artists not the actual music titles. One other problem isthat
there maybe cover art, or other file types in some of the directories - isit
possible to only list the .mp3 file types?
Many thanks again
Gary
.
- Follow-Ups:
- Re: Convert file names to a usable list?
- From: Gary
- Re: Convert file names to a usable list?
- References:
- Re: Convert file names to a usable list?
- From: John
- Re: Convert file names to a usable list?
- From: Gary
- Re: Convert file names to a usable list?
- Prev by Date: Re: Freeing Up Space in my Boot Partition
- Next by Date: Re: un install problem
- Previous by thread: Re: Convert file names to a usable list?
- Next by thread: Re: Convert file names to a usable list?
- Index(es):
Relevant Pages
|