If I want to distribute some software on a bootable CD, is there a way (from windows) to force the machine to restart onto the CD OS, even if the BIOS is not setup with boot from CD?
You can probably make some changes to boot files so that it ignores windows for now, but you're essentially breaking somebodys OS this way.
I think NO...
Boot device selection happens before starting the initialization process of a certain OS. In other words the hardware system will select a drive and then it will try to execute the bootstrap available on the given hardware drive.
So even if you change any setting in windows, you get the control after booting Windows. It is too late.
But perhaps you may have a way with boot.ini pointing your CD drive as a partition, but I don't know whether it is ethical to do such changes in a guest machine. If I wanted to do this I will not use this way.. :)
No, sorry, there is no way to do this because there is no standard BIOS interface to allow programmatically changing the boot order. As you infer in your question, the BIOS (CMOS Setup, to be exact) is the place where the boot order is kept. You cannot guarantee what boot device the user will select on next boot.