Hi all have this code that lists all files in a folder but wanted to have an option to state the file im looking for
ie E:\_Music\mp3\Enigma\The Cross Of Changes\remix.mp3
the following script will just rattle its way through the whole dir, guessing i need to spec the filename and alter the fl but i have had no joy trying to do this , think its quite simple but im simple when it comes to vbs
Sub Main
On Error GoTo Err_1
'***** Read files from selected folder (Directory) *****
Set fs = CreateObject("Scripting.FileSystemObject")
Set dirfolder = fs.GetFolder("E:\_Music\mp3\Enigma\The Cross Of Changes\")
'***** Read files *****
For Each fl In dirfolder.Files
aName = fl.name
aSize = Format(Int(fl.Size / 1024) + 1, "###,###,### KB")
aType = fl.type
aDC = Format(fl.DateCreated, "mm/dd/yyyy")
aDLA = Format(fl.DateLastAccessed, "mm/dd/yyyy")
aDLM = Format(fl.DateLastModified, "mm/dd/yyyy")
aTitle = fl.title
aArtist = fl.Artist
aAlbumTitle = fl.AlbumTitle
aGenre = fl.Genre
MsgBox ":" & aName & ":" & vbCrLf _
& ":" & aSize & ":" & vbCrLf _
& ":" & aType & ":" & vbCrLf _
& ":" & aDC & ":" & vbCrLf _
& ":" & aDLA & ":" & vbCrLf _
& ":" & aDLM & ":" & vbCrLf _
& ":" & aTitle & ":" & vbCrLf _
& ":" & aArtist & ":" & vbCrLf _
& ":" & aAlbumTitle & ":" & vbCrLf _
& ":" & aGenre & ":" & vbCrLf
Next fl
'On Error GoTo Err_1
Exit_1:
Exit Sub
Err_1:
MsgBox "********** In Subroutine Main ********** " & vbCrLf & vbCrLf & Error$
Resume Exit_1
End Sub
ie E:\_Music\mp3\Enigma\The Cross Of Changes\remix.mp3
the following script will just rattle its way through the whole dir, guessing i need to spec the filename and alter the fl but i have had no joy trying to do this , think its quite simple but im simple when it comes to vbs
Sub Main
On Error GoTo Err_1
'***** Read files from selected folder (Directory) *****
Set fs = CreateObject("Scripting.FileSystemObject")
Set dirfolder = fs.GetFolder("E:\_Music\mp3\Enigma\The Cross Of Changes\")
'***** Read files *****
For Each fl In dirfolder.Files
aName = fl.name
aSize = Format(Int(fl.Size / 1024) + 1, "###,###,### KB")
aType = fl.type
aDC = Format(fl.DateCreated, "mm/dd/yyyy")
aDLA = Format(fl.DateLastAccessed, "mm/dd/yyyy")
aDLM = Format(fl.DateLastModified, "mm/dd/yyyy")
aTitle = fl.title
aArtist = fl.Artist
aAlbumTitle = fl.AlbumTitle
aGenre = fl.Genre
MsgBox ":" & aName & ":" & vbCrLf _
& ":" & aSize & ":" & vbCrLf _
& ":" & aType & ":" & vbCrLf _
& ":" & aDC & ":" & vbCrLf _
& ":" & aDLA & ":" & vbCrLf _
& ":" & aDLM & ":" & vbCrLf _
& ":" & aTitle & ":" & vbCrLf _
& ":" & aArtist & ":" & vbCrLf _
& ":" & aAlbumTitle & ":" & vbCrLf _
& ":" & aGenre & ":" & vbCrLf
Next fl
'On Error GoTo Err_1
Exit_1:
Exit Sub
Err_1:
MsgBox "********** In Subroutine Main ********** " & vbCrLf & vbCrLf & Error$
Resume Exit_1
End Sub