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.
This topic is 13 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
mikemike
Posts: 7
Last visit: Thu Oct 28, 2010 12:35 pm

Need Help with Batch File...

Post 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.
User avatar
jhicks
Posts: 1789
Last visit: Mon Oct 19, 2015 9:21 am

Need Help with Batch File...

Post 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.
User avatar
mikemike
Posts: 7
Last visit: Thu Oct 28, 2010 12:35 pm

Need Help with Batch File...

Post 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.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Need Help with Batch File...

Post 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.
User avatar
mikemike
Posts: 7
Last visit: Thu Oct 28, 2010 12:35 pm

Need Help with Batch File...

Post 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
User avatar
mikemike
Posts: 7
Last visit: Thu Oct 28, 2010 12:35 pm

Need Help with Batch File...

Post 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.
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Need Help with Batch File...

Post 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!
	
 
	
This topic is 13 years and 10 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked