Windows Scripting
  Home arrow Windows Scripting arrow Using WSH to Catalog MP3 Files
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
WINDOWS SCRIPTING

Using WSH to Catalog MP3 Files
By: Nilpo
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-10-01

    Table of Contents:
  • Using WSH to Catalog MP3 Files
  • Creating the database
  • Updating the database
  • Finishing the script

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Using WSH to Catalog MP3 Files


    (Page 1 of 4 )

    In my last article I introduced you to a workaround that allows you to read MP3 ID3 tags in WSH. Today I’m going to show you how to create a database for cataloging those MP3 files.If you haven’t read “Reading MP3 ID3 Tags is WSH” you should go do that now.  We’ll be building off the code created in that article. Without further ado, let’s get going.

    strDatabase = "mp3catalog.mdb"

    You’ll want to begin your script by specifying a database to use.  It doesn’t have to exist.  The script will check for the file and create it if it doesn’t.  If it does, however, the script will instead update the existing database file.

    Dim intSize, intTitle, intComments, intArtist, intAlbumTitle

    Dim intYear, intTrack, intGenre, intDuration, intBitRate

    Next, you’ll want to instantiate a few variables that will be used to hold Column ID numbers.  You won’t generally see me using the Dim statement in my code, but in this case it’s necessary.

    As you may remember from my last article, the column IDs we’ll be using vary across different versions of Windows.  I’ve created a subroutine that will check the currently running version of Windows and assign the correct column IDs accordingly.  Since this is done as a subroutine, it’s important to instantiate the variables first so that they are available globally.

    Call SetColIds

    Now is a good time to call that subroutine so that our variables will have the proper values.  We’ll create the subroutine here in a bit.

    Set objFso = CreateObject("Scripting.FileSystemObject")

    Set objShell = CreateObject("Shell.Application")

    Set objFolder = objShell.BrowseForFolder(0, _

       "Please select a folder containing MP3 files.", 0)

    Finally, we’ll instantiate the objects that we need.  The FileSystemObject will be used to determine whether or not the database file exists.  We use the Shell object and its BrowseForFolder method to display a dialog box for the user to select a folder to catalog.  The script will find all MP3 files in the specified folder.

    More Windows Scripting Articles
    More By Nilpo


       · If you read my last article, you learned how to read MP3 ID3 tags in WSH. Let's...
     

    WINDOWS SCRIPTING ARTICLES

    - Introducing Two-Way Data Binding using Silve...
    - Silverlight 2.0 Application Development with...
    - Burning Multisession CDs with IMAPI2 in WSH
    - Creating a Silverlight 2.0 Application that ...
    - Burning CDs with the IMAPI2 Control
    - Burning CDs in Windows XP with WSH
    - Advanced Word Object Scripting
    - Reading and Printing Word Documents in WSH
    - Scripting Microsoft Word
    - Using WSH to Catalog MP3 Files
    - Reading MP3 ID3 Tags in WSH
    - A Brief Look at Menus in WPF
    - More Examples of Simplified Image Processing...
    - Completing a WPF To-Do List Application
    - Simplified Image Processing in GDI+





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway
    Stay green...Green IT