Hi guys,I want to make an ambitious recursive batch file which loops through a website-style file structure until there are no child folders, then runs mencoder on the collection of video files in that final folder, saving it in the root folder (where the batch was run from) as the folder path to the file with the "\" replaced with ".". for example:

Obviously the point of this is to generate a lot of files not just one, so when a file is created, (after possibly deleting the source files once I know this works) the pointer moves back up to the parent folder until it finds a sibling folder, then progresses down that route...etc hence the recursive nature of this batch file, exactly like a binary tree.

STARTfor each folder in root if folder contains a sub-folder add folder name to file name string followed by "." add folder to root path string goto START else run mencoder with all files in folder delete source video files

The main problems I am aware of are the fact this isn't like a programming language and doesn't have methods, making the recursive bit complicated, in terms of keeping track of the current folder and although I am (maybe) obviously a programmer I don't have a clue about DOS syntax. It would be great if I could collect building blocks of knowledge and do it myself, but I can appreciate it's less hassle and quicker for you guys to just make suggestions.

thanks for the reply, It seems to find the files, but there are some problems; - It only does one type of video file at a time, is there a way to make it recognize wmv avi and mpg in the same script (other than using *.*)?- The *out string shouldn't include the individual file name (.1.mpg, .2.mpg, etc.), just the video format. As the purpose of that string is to give an output file name to mencoder for the combined video file.- Running mencoder, is an important part I need help with because I have to pass the file names of all the video files in the deepest folder(s) in one line dynamically.