Nircmd from nirsoft.net has a TON of useful little commands built into it.

cdrom open cdrom close cdrom open J: cdrom close R:

http://www.nirsoft.net/utils/nircmd.html