Results 1 to 15 of 15
  1. #1
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Texas, USA
    Posts
    374
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Duration of music folder (XP Home SP2)

    How to get the music duration of each folder and subfolder in my hard drive? The Windows Explorer displays only the duration of each music file within the folder, not the duration of each folder.

  2. #2
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Duration of music folder (XP Home SP2)

    If you load the (contents of the) folder up into something like Windows Media Player, does it not give you a total playing time?

  3. #3
    3 Star Lounger
    Join Date
    Dec 2000
    Location
    Texas, USA
    Posts
    374
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Re: Duration of music folder (XP Home SP2)

    Leif,

    Thanks! Yes, I can use Windows Media to see the total playing time by adding folder to the library one at a time. It is very time consuming when there are many folders and files. However, if there are no other faster ways, I will use it.

  4. #4
    Plutonium Lounger Leif's Avatar
    Join Date
    Dec 2000
    Location
    U.K.
    Posts
    14,010
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Duration of music folder (XP Home SP2)

    You might find Power Desk - an alternative to Windows Explorer - will give you the total running times. (I think it used to be free, but I'm not sure it is any longer.)

  5. #5
    Plutonium Lounger
    Join Date
    Oct 2001
    Location
    Lexington, Kentucky, USA
    Posts
    12,107
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Duration of music folder (XP Home SP2)

    And, if that doesn't work out, how about this? In <!post=this post,530,785>this post<!/post> and others, I mentioned a utility called FileGrab. It's pretty old and still works in WinXP but you will have to pay a modest fee to download a copy. FileGrab allows you to grab a selected list of files from Windows Explorer and save that list to a text file. You could do a Win Explorer search for MP3 for example, have the columns display duration, select any or all of the files in the usual manner and drag the selection to FileGrab. From there it's an easy proposition to save the text and turn it into a spreadsheet.

    If you needed to repeat the process for more than one drive or directory, that's OK too, for FileGrab will let you keep adding to your heart's content and save when you're ready.

    Edited With Correction: I just got around to doing a test on my suggestion and I'm sorry to say it DOES NOT work, so save yourself the trouble. It seems that FileGrab only recognizes the columns of info that were around when it was written. I dragged a bunch of files with the duration column included and it's ignored by FileGrab. Sorry.

  6. #6
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Duration of music folder (XP Home SP2)

    This (Word 2000 VBA) code will dump all details of all files in a single folder to the current document.
    The code dumps the total duration for the folder as the last line.
    I cloned it from microsoft technet script center
    <pre>Sub test()
    Dim objshell
    Dim objfolder
    Dim arrHeaders(35)
    Set objshell = CreateObject("Shell.Application")
    Set objfolder = objshell.Namespace("D:Blotter20080913Music")
    Dim i
    For i = 0 To 34
    arrHeaders(i) = objfolder.GetDetailsOf(objfolder.Items, i)
    Next
    Dim strFilename
    Dim dtDuration As Date
    For Each strFilename In objfolder.Items
    For i = 0 To 34
    Selection.TypeText vbTab & objfolder.GetDetailsOf(strFilename, i)
    Next
    dtDuration = dtDuration + CDate(objfolder.GetDetailsOf(strFilename, 21))
    Selection.TypeText vbCrLf
    Next
    Selection.TypeText dtDuration & vbCrLf
    End Sub</pre>


  7. #7
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Duration of music folder (XP Home SP2)

    I was inspired to try to add a cut-down version of this (in the form of a VBScript) to Explorer's right-click menu, but when I try to run the script from the right-click menu, a dialog box pops up that shows the name of the folder and says "Access is denied."

    It looks like I can run the script from a batch file and assign the batch file to the right-click menu item, but that seems goofy (and it means you get a gratuitous command window popping up). Anybody know why I can't run the script directly from Explorer's right-click menu, and if that's fixable?

  8. #8
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Duration of music folder (XP Home SP2)

    >try to add ... to Explorer's right-click menu
    OK smarty!
    First question: How do I add something to Explorer's r/c menu?
    (I can see my client's tasks flying out of today's window right now ....)

  9. #9
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Duration of music folder (XP Home SP2)


  10. #10
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Duration of music folder (XP Home SP2)

    >Here are Microsoft's official instructions.
    Thanks st3333ve
    I got a bit of a scare when my printer sprinted into life - serves me right for pasting the batch file without reading it to see what it did!
    I followed steps 1 &2 and it worked. I can't see why step 3 is required.

    >Anybody know why I can't run the script directly from Explorer's right-click menu
    Have you been able to run any script from r/c?

  11. #11
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Duration of music folder (XP Home SP2)

    If you don't do step 3, you may well find that double-clicking on a folder (in Explorer) triggers a result other than "Open" -- because the default action tends to get screwed up when you make other adjustments (like adding a new menu item). I installed Service Pack 3 last week, and am I surprised that Microsoft has never gotten around to fixing that annoying bug? No, I am not surprised. Not surprised in the least, really. Actually, come to think of it, if they had fixed the bug, I would have been surprised.

    As for your 2nd question: No, no script will run. I made a one-line test script (MsgBox "Howdy") and got the same "Access is denied" result -- and it doesn't matter whether I use WScript or CScript as the processor.

    I should add that Windows adds "percent-symbol 1" to the end of the command line (if you don't), and the "Access is denied" error dialog I'm getting always displays the name of the folder I right-clicked -- even when, as in my one-line test script, the script itself isn't trying to actually access the folder.

    I'm guessing it's a security thing, although if that's the case it seems goofy that I can get around the security by simply turning the command line into a batch file and then running the batch file from the right-click menu.

  12. #12
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Yilgarn region of Toronto, Ontario
    Posts
    5,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Duration of music folder (XP Home SP2)

    >If you don't do step 3 ...
    OK. I went to do it and found ("In the Value data box, type none.") that my value was already "none"

    >... Windows adds "percent-symbol 1" ... name of the folder I right-clicked -
    This sounds to me like half-baked code, the sort that gets released with a few odds and ends left unfinished - debugging code in place - when a programmer is yanked off a module before it is tidied up. The module remains frozen in it 95% state forever. I've worked on projects like that.

    >seems goofy ... then running the batch file
    Take heart.
    Some of my finest stuff still runs from a batch file, quietly, no fanfare, during boot time or to drive useful applications. I get used to seeing the black window appear, but enjoy getting on with what i have to do.

    I quite agree it seems strange that a script cannot be hooked on to a r/c menu, whereas an executable can be hooked.

  13. #13
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Duration of music folder (XP Home SP2)

    Just to clarify: Windows doesn't add the words "percent-symbol" -- it appropriately adds the percent-symbol (followed by the number 1). But I don't know how to put that combination in a Lounge post, so I used the words instead.

  14. #14
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Duration of music folder (XP Home SP2)

    If you try to include a % symbol immediately followed by a number such as 1, havoc ensues because such combinations play a special role in HTML. You can work around it by placing square brackets around the % symbol: <!t>[%]<!/t>1 will be converted to %1 when posted.

  15. #15
    5 Star Lounger st3333ve's Avatar
    Join Date
    May 2003
    Location
    Los Angeles, California, USA
    Posts
    705
    Thanks
    0
    Thanked 2 Times in 2 Posts

    Re: Duration of music folder (XP Home SP2)

    Thanks, Hans. I expect I knew that once (or twice) and forgot. (I couldn't find anything in the Help, but didn't spend a lot of time searching.)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •