Yafray will not execute from DOS (Windows)

When I try to run yafray from DOS with

yafray yable.xml 

It gives me the error

'yafray' is not recognised as an internal or external comand,
operatable program or batch file.

It sounds like you don’t have YafRay set in your PATH environment variable, so the system doesn’t know where to look to find it.

Find the directory where you have YafRay installed. There is a file README.txt that has the instructions on setting the path variable for different windows versions.

Thanks! Is there any way to get yafray to render a sequence of xml files?

Not sure if there’s any way within yafray itself (I haven’t really used it through its XML interface) … however I’d imagine you should be able to string together a *.bat file that runs a bunch of them in sequence.

ex: ‘foo.bat’ contains
yafray file1.xml
yafray file2.xml
yafray file3.xml
… and so on

Then you just run ‘foo.bat’ from the command line.

Batch files are the dos way of automating shell commands. Not quite as powerful as unix shell scripting, but quite adequate for many mundane tasks.

Not sure if there’s any way within yafray itself (I haven’t really used it through its XML interface) … however I’d imagine you should be able to string together a *.bat file that runs a bunch of them in sequence.

ex: ‘foo.bat’ contains
yafray file1.xml
yafray file2.xml
yafray file3.xml
… and so on

Then you just run ‘foo.bat’ from the command line.

Batch files are the dos way of automating shell commands. Not quite as powerful as unix shell scripting, but quite adequate for many mundane tasks.[/quote]
yeah I was afraid i would have to wright a batch file. BTW what are the differences between and batch file and a shell script?

They’re really the same thing, but the term ‘batch file’ is generally understood to mean it is for windows/dos and ‘shell script’ understood to be for unix-based systems.

Both are ways of passing commands and some scripting to the shell interpreter. Typically, unix shell scripts are written to be interpreted by ‘sh’ as it is very widely deployed and you can pretty much count on it being on any system - though you can write your files to be interpreted by another interpreter, such as ‘bash’ or ‘tcsh’ using specifics to those interpreters at the expense of lower portability. You can also write your script to be interpreted by ‘perl’ or ‘python’ or any other language on the system.
The interpreter used is defined in the first line of the script:
#!/usr/bin/bash

The DOS/Windows command interpreter can also be scripted to some degree. Historically, those files (*.bat) were used to handle batch file operations, so they’ve become known as batch files, even though you may not necessarily be doing “batch” operations per se. Like unix shell scripting, you can do more than just issue interpreter commands (there are logical operators and such) but since Windows is designed as a UI-leaning operating system (and less reliant on the command shell), you are less likely to find resources for writing anything but the most basic batch files. (There’s stuff on the web, or dig through old DOS-era articles)

Fundamentally, though. They both exist as a way of performing shell operations automatically. And since they are text based, they are easy to generate by other processes if need be.

Ok I have written a batch file. For anyone else who needs it this is the code:

for %%f in (yable.*.xml) do \progra~1\yafray\yafray %%f

just replace yable.*.xml with your own file. The star represents the number eg yable.0023.xml.