Page 1 of 1

Need Help with Batch File...

Posted: Tue May 18, 2010 2:05 pm
by mikemike
I am trying to automate a batch file I created to process audio files. No matter what I try nothing works.
Here is the manual process I'm using today:
-There is a local folder that called "unknown_audio" where .wav files are automatically pushed to from the server in numerical order.

-When the .wav file is in the "unknown_audio"folder I then go to the command line in windows and input the following:

step 1 - cd C:MMArelease
step 2 - IDFile C:MMAunknown_audiochannel1channel10549.wav C:MMAresponseschannel1Response

Then I hit enter and the process runs.

channel10549.wav is the input file (I have to input this variable each time)channel1Response is the output folder

I then receive a response from the server and the response is stored in the "response" folder on my local machine.

I want to have a complete script that will watch the folder where the .wav files are stored, import .wav file name for step 2 and then run the .bat automatically, and then close the command line window when completed.

This is a little beyond me and I need some help/advice on how to get it done.

Need Help with Batch File...

Posted: Wed May 19, 2010 2:14 am
by jhicks
It might still be possible to use a simple batch file you run every X number of minutes. Using an event can be done but is much more complicated. Is IDFile a command line tool? What sort of response do you get? If it is simple stdout, your script could be as simple as this:for /f %i in ('dir c:MMARelease*.wav /b') do @IDFile c:work%i C:MMAresponseschannel1Response >>c:results.txtThis is just a starting point.

Need Help with Batch File...

Posted: Wed May 19, 2010 6:43 am
by mikemike
Thanks for the info. I have to do some research to learn more. I see how to watch a folder which is perfect, but I do not see anything to automatically run the batch file. I'm a new at this. Thanks for your patience.

Need Help with Batch File...

Posted: Wed May 19, 2010 7:50 am
by jvierra

I want to have a complete script that will watch the folder where the .wav files are stored, import .wav file name for step 2 and then run the .bat automatically, and then close the command line window when

Sounds like eventing to me.

Need Help with Batch File...

Posted: Wed May 19, 2010 7:54 am
by mikemike
I get a .request and xml file back when the process runs. I then import the xml into a database. I am not familiar with the software mentioned in the last post. Here is a more detailed description of what I want to do:

Process to automate
1. Completed .wav file is placed in

Need Help with Batch File...

Posted: Wed May 19, 2010 12:05 pm
by mikemike
Yes. I already have the batch file. I need it to run only when a .wav file is deposited into a particular folder. While the .wav file is being recorded the files name shows up in the folder before it is completed. I need to make sure that the program does not try to run before the .wav is complete.
Each .wav is 1 hour 30 seconds in length. There are ten .wav files deposited per hour, but the moment recording starts the .wav shows up in the folder incomplete and still building.
I need a program that is smart enough to start when the .wav files are completely recorded.

Need Help with Batch File...

Posted: Wed May 19, 2010 4:36 pm
by jvierra
Here is a batch file that wil wait on a file that is locked until it is movable then it will move the file and quit.

Code: Select all

	
:loop

	
      move tester.usr c:temp3 2>nul:
      IF ERRORLEVEL == 1 GOTO sleeper
	
      goto exit
	
 
	
:sleeper
	
     sleep 30
	
     goto loop
	
 
	
:exit
     echo Done!