Log in

View Full Version : Question about auto generating scripts.


junglemike
12th July 2010, 15:41
HI fellas. Even though this is not related to avisynth directly, someone hopefully can help me.

I'm using this command to auto generate avs scripts for all the files in specific directory:

for %f in (*.avi) do echo
LoadPlugin ("c:\Program Files\AviSynth 2.5\plugins\undot.dll")
AVISource("P:\Camera_vids\%f",false)
lanczosresize(512,384)
undot() > "p:\scripts\%f.avs"

But what is I have some more than one folder, (say , a complete folder hierarchy 3 levels deep), and I would like to generate scripts for all specific (.avi) files in all the folders.
Any Idea how to do this?

Sir BlunderBrain
12th July 2010, 23:19
The joy of batch programming.. :)

You can get a full traversal of your folder hierarchy by adding the /R parameter to the For command

for /R . %f in (*.avi) do echo
LoadPlugin ("c:\Program Files\AviSynth 2.5\plugins\undot.dll")
AVISource("P:\Camera_vids\%f",false)
lanczosresize(512,384)
undot() > "p:\scripts\%f.avs"

Note the '.' after /R - This makes the command traverse the current directory and any subfolders. You can replace the '.' with a specific path you want to process if you like.

Hope this helps.