Disable CD-ROM in BIOS
I have a Lenovo T420 laptop. The reason I want to disable the CD-ROM is because when moving the laptop, I often unintentionally press the eject button, which turns on CD-ROM's power and pops the tray open - it's annoying for me. I am looking for a way to power off CD-ROM, and only power back on when I re-configure it, preferably done through the BIOS.
Disabling the effect of the eject button can be controlled at the OS level. Use CDRom-Lock or eject -i on
to lock the drive closed.
There is no way ti disable the drawer button in the BIOS. Disabling the optical drive in Device Manager will not affect the drawer button.
There is a "door lock" (and corresponding "door unlock") command in the low-level ATA command set. I have no idea if anyone ever implemented a utility to do what you're asking. (There's a possibility that some optical drives will reject the "door lock" command when the drawer is empty.)
Have you considered simply removing the entire optical drive out of its bay? It's two seconds to pop out the drive (slide the tab release, and then pull on the tab), and another second to pop it back in.
I wrote LockCD application after giving up on finding a properly functioning software that would lock the CD ROM eject button which i hit quite frequently on my Lenovo T520 laptop. The main problem with the software found over the internet was that it wouldn't retain the lock state after Sleep/Resume. I made it freely available at http://sourceforge.net/p/lockcd/wiki/Home/