Jump to content

batch file help


Recommended Posts

Hey guys, I got a question for ya. I'm pretty new to creating batch files and scripting and such, and I've been trying to work on a batch file that would move all the mp3s in my iTunes music directory into a single directory. The files are located here.

C:\somestuff\somemorestuff\iTunesmusic\variousartists\variousalbums\*.mp3

I'm trying to get them here.

C:\somestuff\somemorestuff\Mp3s

I tried using the copy cammand with an "*" for the \various artists and \variousalbums but that didn't work. I messed around a bit with the pipe command, but couldn't get anything to work for me. Any ideas? is this possible to do without having to list the exact path for each album?

Link to comment
Share on other sites

Welcome to the Windows Forum.

Try the xcopy command instead - it is much more powerful.

Thank you very much sir.

I did try the xcopy command, using

@echo off

xcopy /s "C:\Users\myownuser\Desktop\iTunes Music\*.mp3" "C:\Users\myownuser\Desktop\Mp3s"

(the /s, as i just learned, is used to copy all sub directories, and since adding in the "*" for \variousartists \variousalbums wasn't working, i left those 2 directories out)

and it appeared to be working at first, until I checked in the \mp3s folder and found that it copied all of the sub directories as well, not just the .mp3 files like I wanted it too. I think I am closer to figuring out if there is a way to do this, and I am continuing to research it, however if anyone has any idea please let me know. It may make my life a whole lot easier =)

Link to comment
Share on other sites

xcopy /t "C:\somestuff\somemorestuff\Mp3s" 
/s "C:\somestuff\somemorestuff\iTunesmusic\variousartists\variousalbums\.mp3"
"C:\somestuff\somemorestuff\Mp3s"

XCOPY won't work if a subdirectory is empty.

Try seperating the commands and not bundling them together too.

I'm not good at all with Batch Scripting but maybe that may work...

/T creates a directory structuer.

/S ....

Link to comment
Share on other sites

xcopy /t "C:\somestuff\somemorestuff\Mp3s" 
/s "C:\somestuff\somemorestuff\iTunesmusic\variousartists\variousalbums\.mp3"
"C:\somestuff\somemorestuff\Mp3s"

XCOPY won't work if a subdirectory is empty.

Try seperating the commands and not bundling them together too.

I'm not good at all with Batch Scripting but maybe that may work...

/T creates a directory structuer.

/S ....

Hmmm i think understand what your saying, but i don't think its quite what i'm looking for. currently I have 500 different artists on my computer, each with their own folder. Then, a folder for each album inside the artist folder. Inside each album, are the mp3s. I want to copy all of the mp3s into a single folder, where I can view all of them without having to click through the different folders to find them.

xcopy will work if a sub directory is empty, as long as you use /e along with the /s if I remember correctly.

Link to comment
Share on other sites

Hey guys, I'm in no rush to get/figure out the code that I need to complete the task that I want to do, but I do find it hard to believe that nobody that has looked at this post doesn't know scripting, or writing code in general, well enough to complete this task. Don't get me wrong, I appreciate any help I might get. I'm a student at ITT Technical Institute right now, and I plan on making a career out of this stuff. (for the money i'm paying, it better be a pretty damn well paying career =P) If anyone doesn't know the answer, but has a suggestion, I'd like to hear it. It'd help me out a lot. As well as any advice about anything at all. I'll take knowledge any way i can get it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy