Quick Search for:  in language:    
WSH,script,uses,organize,folder,MP3s,album,na
   Code/Articles » |  Newest/Best » |  Community » |  Jobs » |  Other » |  Goto » | 
CategoriesSearch Newest CodeCoding ContestCode of the DayAsk A ProJobsUpload
ASP/ VbScript Stats

 Code: 196,174. lines
 Jobs: 109. postings

 How to support the site

 
Sponsored by:

 
You are in:
 
Login


 

 


Latest Code Ticker for ASP/ VbScript.
Click here to see a screenshot of this code!Gallery Image with Zoom
By Marcelo Valle Franco on 1/12

(Screen Shot)

ASP Photo Competition
By Saul Bryan on 1/12


Execute DTS package
By Himadrish Laha on 1/12


Connecting to a MySQL with ADO, DAO and RDO
By Ahmed Magdy Ezzeldin on 1/11


Automatic Form Insertion To Database
By Yasar Bayar on 1/11


Click here to see a screenshot of this code!Find Closest Physical Location (based on zip code, etc)
By Mark Kahn on 1/11

(Screen Shot)

String --> SQL Search Query
By Mark Kahn on 1/11


Replace text/Numbers for Images...
By Kenneth Nilsson on 1/9


INSERT sentence generator
By Eitan Rousso on 1/8


Click here to put this ticker on your site!


Add this ticker to your desktop!


Daily Code Email
To join the 'Code of the Day' Mailing List click here!

Affiliate Sites



 
 
   

mp3org.vbs

Print
Email
 
VB icon
Submitted on: 12/24/2003 12:50:55 PM
By: Sean Anderson 
Level: Intermediate
User Rating: Unrated
Compatibility:VbScript (browser/client side)

Users have accessed this code 510 times.
 
 
     This script uses WSH to organize a folder of MP3's by album name
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
 
Terms of Agreement:   
By using this code, you agree to the following terms...   
1) You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.   
2) You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
3) You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
4) You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.

    '**************************************
    ' Name: mp3org.vbs
    ' Description:This script uses WSH to or
    '     ganize a folder of MP3's by album name
    ' By: Sean Anderson
    '
    ' Inputs:The script uses source folder a
    '     nd destination folder eg. mp3org c:\cabi
    '     net d:\orgcabinet
    '
    ' Returns:NOthing
    '
    ' Assumes:This script assumes that the d
    '     estination folder already exists, it wil
    '     l check for existence for sure, but does
    '     not create if it does not. Also the scri
    '     pt assumes that the source folder has on
    '     ly MP3 files and no other file type or s
    '     ubfolders. Also it assumes that album in
    '     formation is stored in the file summary
    '
    'This code is copyrighted and has    ' limited warranties.Please see http://w
    '     ww.Planet-Source-Code.com/vb/scripts/Sho
    '     wCode.asp?txtCodeId=8668&lngWId;=4    'for details.    '**************************************
    
    '**
    '**
    '** Script Name: mp3org.vbs
    '** Author: Sean Anderson (sanderson_20@
    '     yahoo.com)
    '**
    '** Description: THis script looks a fol
    '     der filled with MP3's, and based on the 
    '     album information
    '** in the summary information of the fi
    '     le, creates the album folder in specifie
    '     d destination folder.
    '** This script can certainly be edited 
    '     to work with any file type. There is not
    '     much error checking in the script
    '** as wrote it for personal use, but fe
    '     el to adapt for your own use.
    '**
    '**
    Dim oArgs
    Dim dFile
    Dim objFSO
    Dim sFolder, dFolder
    Dim Folder
    Dim sFile
    Set oArgs = WScript.Arguments
    Set objFSO = CreateObject("Scripting.FileSystemObject")
    '
    'Check command line arguments, and promp
    '     t with porper usage.
    '
    if oArgs.Count <> 2 Then
    	WScript.Echo "USAGE: mp3org [mp3 source folder] [mp3 destination folder]"
    	WScript.Quit 1
    End if
    '
    ' Check to make sure folders are valid. 
    '     There are many things that can happen he
    '     re
    ' but for my purpose i kept it simple, a
    '     nd check for existentent folders. Feel f
    '     ree
    ' add folder creation etc. here
    '
    sFolder = oArgs(0)
    dFolder = oArgs(1)
    if Not objFSO.FolderExists(sFolder) Then
    	WScript.Echo "Error: The [mp3 source folder] parameter must be a valid Folder " & _
    	"Instead it was '" & sFolder & "'."
    	WScript.Quit 1
    Else
    if Not objFSO.FolderExists(dFolder) Then
    	WScript.Echo "Error: The [mp3 destination folder] parameter must be a valid Folder " & _
    	"Instead it was '" & sFolder & "'."
    	WScript.Quit 1
    End if
    End if
    '
    'Call sub-routine that does actual clean
    '     up work
    '
    Organize sFolder, dFolder, objFSO
    '
    'Define sub routine that does cleanup an
    '     d pass user folder args
    '
    Sub Organize (Folder1, Folder2, oFSO)
    Dim sFile
    Dim fPath
    Set objShell = CreateObject ("Shell.Application")
    Set objFolder = objShell.Namespace (Folder1)
    '
    '
    For Each strFileName In objFolder.Items
    On Error Resume Next
    	Set sFile = oFSO.GetFile(Folder1 & "\" & strFileName)
    	fPath = sFile.path
    	'
    	'This following line grabs the album name from the MP3 file To enable 
    	'album name folder creation. Album information grabbed from file summary page.
    	'There are tons of info on the summary page, to see whats there, right click on
    	'a MP3 file and click On the summary tab To see what's there, or click advanced
    	'to see.
    	'
    	dstFolder = Folder2 & "\" & objFolder.GetDetailsOf (strFileName, 17)
    	'Here the script checks For the destination name based on the line above
    	'if folder is present Do nothing, if not create it
    	'	
    	if Not oFSO.FolderExists(dstFolder) Then
    		oFSO.CreateFolder(dstFolder)
    	End if
    	'
    	'Copy file In To album folder....and repeat.	
    	'
    	oFSO.CopyFile fPath, dstFolder & "\"
    	Next
    End Sub

 
Report Bad Submission
Use this form to notify us if this entry should be deleted (i.e contains no code, is a virus, etc.).
Reason:
 
Your Vote!

What do you think of this code(in the Intermediate category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor See Voting Log
 
Other User Comments

 There are no comments on this submission.
 
Add Your Feedback!
Note:Not only will your feedback be posted, but an email will be sent to the code's author in your name.

NOTICE: The author of this code has been kind enough to share it with you.  If you have a criticism, please state it politely or it will be deleted.

For feedback not related to this particular code, please click here.
 
Name:
Comment:

 

Categories | Articles and Tutorials | Advanced Search | Recommended Reading | Upload | Newest Code | Code of the Month | Code of the Day | All Time Hall of Fame | Coding Contest | Search for a job | Post a Job | Ask a Pro Discussion Forum | Live Chat | Feedback | Customize | ASP/ VbScript Home | Site Home | Other Sites | About the Site | Feedback | Link to the Site | Awards | Advertising | Privacy

Copyright© 1997 by Exhedra Solutions, Inc. All Rights Reserved.  By using this site you agree to its Terms and Conditions.  Planet Source Code (tm) and the phrase "Dream It. Code It" (tm) are trademarks of Exhedra Solutions, Inc.