PDA

View Full Version : Useful Batch Files


marcorabellini
12-06-2006, 07:48 PM
Hey all,

Here are two batch files that I've written to more efficiently download files from the Net Server and to organize them into RGBA and Object Buffer folders if you've done a Multi-pass render.

A batch file, or .bat file, is a Windows file to do stuff from a Command Line window instead of through the Windows desktop which is a bit faster and more efficient than drag and drop by hand. It's something like a script that runs a tiny application. (That's my interpretation but I may not be 100% accurate as I'm not a systems guy or a programmer.)

In "NET_copy.bat" you must right click and choose edit to open the .bat file to edit the locations. In my example I have "Servo\user\smithy" as where the rendered files are and "F:LRT\Clients\Smithy\toggle_anim\AE files\(footage)" as where I want them to be copied to. These paths are the full paths of the locations since I've going across a network. You can easily get the paths by opening the folder and copying the path in the address bar. You'll want to enclose each path in quotes. The letters after the addresses are various switches: /d copies new files over old ones; /s copies sub-folders; /y suppresses prompting (links to more info below).

Now the tricky one that had me stumped for a long time was the /exclude switch. I couldn't find anything that gave me a good example and did a lot of trial and error to figure it out. I didn't want to copy the texture folder and a few other files back to the workstation so I wanted to use the exclude function. The way you have to set it up is have the .bat file and the exclude.txt file on the same level. Both of mine sit on the desktop. In the exclude.txt file \tex\ means the "tex" folder, .ini means any file ending with .ini, etc. Putting the excludes in a separate file was what had me stumped. The documentation is rather vague on this.

The other file is to organize multi-pass passes into folders. Windows and AE both have trouble managing tens of thousands of files so I need to folderize the passes. I've just written this to folderize RGBA and Object Buffers but you can add whatever file types you need by following the syntax I've used here. The "*" are wildcards.

The first item in quotes is "what files" and the second quotes thing is "where to". In this .bat the switch needs to go before the addresses. I don't know why but that's how it works. You'll need to make folders for the items called out in the file. I've included the RGBA and OB folders here. You might be able to use a wildcard for the file type or take that off altogether. I haven't tested that yet but I'm guessing it would work.

For complete details on xcopy and move commands go to
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/xcopy.mspx?mfr=true

Scroll to the bottom for the link to move and for links to all the command-line options.

Srek
12-06-2006, 09:11 PM
Looks to usefull to me to let it get buried in the main forum, so i moved the thread here.

Cheers
Björn

CGTalk Moderation
12-06-2006, 09:11 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.