Advertisement

05.21.2006 at 06:56AM PDT, ID: 21858361
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

7.6

Work on files in subdirectories: batch or VBScript

Asked by SimonUK in Programming Languages, Windows Batch Scripting

Tags:

Hi all

I'd like to script quite a complex process... preferably using a batch file but VBScript would probably be OK, I'm just less familiar with it.

We've got a network location filled with audio files in the format:

\\servername\audio\DD-MM-YY\HH-MM-SS.mp2

The mp2 files are 15 minutes long so there are 96 files in each DD-MM-YY folder, and there are a fixed number of day folders.  As a new day is created the oldest is deleted.

I want to create a mirror of the entire tree - but I also want to convert the files to a lower quality sample rate.  I can convert individual files using lame.exe like this: (which creates a 16Kbps mono file)

lame --mp2input -m m -a -b 16 file.mp2 file.mp3

I can also convert entire folders using wildcards.

The problem with scripting the process is that every day a new folder is created, and the oldest folder is deleted, so the tree is always changing.

I'm sure it's possible to write a batch file along the lines of:

For every folder in the root
  For every file in the folder
   Lame command as above
  Next
Next

But I don't know the syntax...

Also:

I don't want to process files if they already exist in the destination - and I want the process to remove folders from the destination if they no longer exist in the source.

The destination filename will be the same as the source filename, but the extension will be different - sources end in .mp2 - destinations end in .mp3

I could probably use robocopy.exe to do the mirror process and convert afterwards, which would work if robocopy can be told to only rely on filenames BEFORE the extension, and ignores the fact that the files are actually different - but I would still need to know how to convert files in a changing tree!

Any suggestions?

Thanks !


SimonStart Free Trial
 
Loading Advertisement...
 
[+][-]05.21.2006 at 07:01AM PDT, ID: 16728469

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.21.2006 at 07:23AM PDT, ID: 16728722

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2006 at 09:28AM PDT, ID: 16729106

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming Languages, Windows Batch Scripting
Tags: vbscript
Sign Up Now!
Solution Provided By: JesterToo
Participating Experts: 3
Solution Grade: A
 
 
[+][-]05.21.2006 at 09:32AM PDT, ID: 16729115

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.21.2006 at 11:59AM PDT, ID: 16729558

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2006 at 02:01AM PDT, ID: 16732784

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2006 at 02:24AM PDT, ID: 16732907

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.22.2006 at 10:07AM PDT, ID: 16735968

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.22.2006 at 04:39PM PDT, ID: 16738762

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.23.2006 at 08:53AM PDT, ID: 16743581

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.23.2006 at 09:01AM PDT, ID: 16743666

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32