Need Help with Batch File...

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
mikemike
Posts: 7
Joined: Tue May 18, 2010 1:39 pm

Need Help with Batch File...

Post by mikemike » Tue May 18, 2010 2:05 pm

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.

User avatar
jhicks
Posts: 1789
Joined: Sun Jan 21, 2007 11:31 pm

Need Help with Batch File...

Post by jhicks » Wed May 19, 2010 2:14 am

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.

User avatar
mikemike
Posts: 7
Joined: Tue May 18, 2010 1:39 pm

Need Help with Batch File...

Post by mikemike » Wed May 19, 2010 6:43 am

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.

User avatar
jvierra
Posts: 13681
Joined: Tue May 22, 2007 9:57 am
Contact:

Need Help with Batch File...

Post by jvierra » Wed May 19, 2010 7:50 am


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.

User avatar
mikemike
Posts: 7
Joined: Tue May 18, 2010 1:39 pm

Need Help with Batch File...

Post by mikemike » Wed May 19, 2010 7:54 am

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

User avatar
mikemike
Posts: 7
Joined: Tue May 18, 2010 1:39 pm

Need Help with Batch File...

Post by mikemike » Wed May 19, 2010 12:05 pm

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.

User avatar
jvierra
Posts: 13681
Joined: Tue May 22, 2007 9:57 am
Contact:

Need Help with Batch File...

Post by jvierra » Wed May 19, 2010 4:36 pm

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!
	
 
	

Locked