Copy and Rename .mp3 Files
Posted: 03 Jun 2009 22:52
For about two days now I've been trying my hand at making a Windows XP batch script designed to copy and rename .mp3 files from one location to the other without any significant luck. In detail, I'm attempting to select multiple mp3 files with the name format "ARTIST - TRACKNAME" from a singular music directory and drag them over the batch file so that they can be copied to the same location as the batch file, only organized into folders starting with the mp3's artist, then album, then "TRACKNUMBER TRACKNAME" for the copy's new file name. This is my first foray into making Windows batch files so I've been trying to make a simple batch and build it up as I go. So far, I have this:
Already, however, two issues are very prevalent. First, I can not pass files in by dragging and dropping them over the batch script icon. For every file I try to use like this the script prints out "Invalid number of parameters". Secondly, despite the /I and /Y tags on the xcopy function, the batch prompts me to choose whether or not any unmade directories should be files or directories. Can I not automate this so the decision should automatically be for directories? Thanks for all the help in advance.
Code: Select all
@echo off
@setlocal EnableDelayedExpansion
@FOR %%I IN (%*) DO (xcopy %%I .\Music /C /D /H /I /K /Q /R /Y)
pause
Already, however, two issues are very prevalent. First, I can not pass files in by dragging and dropping them over the batch script icon. For every file I try to use like this the script prints out "Invalid number of parameters". Secondly, despite the /I and /Y tags on the xcopy function, the batch prompts me to choose whether or not any unmade directories should be files or directories. Can I not automate this so the decision should automatically be for directories? Thanks for all the help in advance.